[Debug] fix debug handlers config

This commit is contained in:
Nicolas Grekas 2014-06-02 18:17:09 +00:00
parent 315c3e50d8
commit e1ba70ecb9

View File

@ -34,10 +34,11 @@ class DebugHandlersListener implements EventSubscriberInterface
public function configure()
{
if ($this->exceptionHandler) {
$mainHandler = set_exception_handler('var_dump');
$handler = set_exception_handler('var_dump');
$handler = is_array($handler) ? $handler[0] : null;
restore_exception_handler();
if ($mainHandler instanceof ExceptionHandler) {
$mainHandler->setHandler($this->exceptionHandler);
if ($handler instanceof ExceptionHandler) {
$handler->setHandler($this->exceptionHandler);
}
$this->exceptionHandler = null;
}