diff --git a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md index 1cea996568..c662ac0149 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md @@ -4,7 +4,7 @@ CHANGELOG 5.0.0 ----- - * removed the `ExceptionController::templateExists()` method + * removed the `ExceptionController`, use `ExceptionPanelController` instead * removed the `TemplateManager::templateExists()` method 4.4.0 diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php deleted file mode 100644 index 8a225b7ae4..0000000000 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Controller; - -use Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Profiler\Profiler; -use Twig\Environment; - -@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ExceptionController::class, ExceptionPanelController::class), E_USER_DEPRECATED); - -/** - * ExceptionController. - * - * @author Fabien Potencier - * - * @deprecated since Symfony 4.4, use the ExceptionPanelController instead. - */ -class ExceptionController -{ - protected $twig; - protected $debug; - protected $profiler; - private $errorRenderer; - - public function __construct(Profiler $profiler = null, Environment $twig, bool $debug, FileLinkFormatter $fileLinkFormat = null, HtmlErrorRenderer $errorRenderer = null) - { - $this->profiler = $profiler; - $this->twig = $twig; - $this->debug = $debug; - $this->errorRenderer = $errorRenderer; - - if (null === $errorRenderer) { - $this->errorRenderer = new HtmlErrorRenderer($debug, $this->twig->getCharset(), $fileLinkFormat); - } - } - - /** - * Renders the exception panel for the given token. - * - * @return Response A Response instance - * - * @throws NotFoundHttpException - */ - public function showAction(string $token) - { - if (null === $this->profiler) { - throw new NotFoundHttpException('The profiler must be enabled.'); - } - - $this->profiler->disable(); - - $exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException(); - - return new Response($this->errorRenderer->getBody($exception), 200, ['Content-Type' => 'text/html']); - } - - /** - * Renders the exception panel stylesheet for the given token. - * - * @return Response A Response instance - * - * @throws NotFoundHttpException - */ - public function cssAction(string $token) - { - if (null === $this->profiler) { - throw new NotFoundHttpException('The profiler must be enabled.'); - } - - $this->profiler->disable(); - - return new Response($this->errorRenderer->getStylesheet(), 200, ['Content-Type' => 'text/css']); - } -} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml index 0d68bf00b0..f9fc312101 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml @@ -22,15 +22,6 @@ - - - - %kernel.debug% - - - The "%service_id%" service is deprecated since Symfony 4.4, use the "web_profiler.controller.exception_panel" service instead. - -