Symfony Debug to Error Handler Component
Since symfony 4.4 the symfony/debug component is deprecated.
The “\Symfony\Component\Debug\ErrorHandler” class is deprecated since Symfony 4.4, use “\Symfony\Component\ErrorHandler\ErrorHandler”
Running unit tests on Mascot, I noticed lots of warnings.
But it was not easy as changing Symfony\Component\Debug\ExceptionHandler to Symfony\Component\ErrorHandler\ErrorHandler.
Assume we have something as below
37 38 39 40 41 42 43 44 <?php $handler = new \Symfony\Component\Debug\ExceptionHandler($debug); $exception = $event->getThrowable(); if (!$exception instanceof FlattenException) { $exception = FlattenException::create($exception); } $response = Response::create($handler->getHtml($exception), $exception->getStatusCode(), $exception->getHeaders())->setCharset(ini_get('default_charset')); $event->setResponse($response); The Symfony\Component\ErrorHandler\ErrorHandler has no getHtml method.
From the symfony docs, if you are in development mode we can use below code.