diff --git a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md index e082d113208db..253c125e12655 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md @@ -7,7 +7,7 @@ CHANGELOG * Added button to clear the ajax request tab * Deprecated the `ExceptionController::templateExists()` method * Deprecated the `TemplateManager::templateExists()` method - * Deprecated the `ExceptionController` in favor of `ExceptionErrorController` + * Deprecated the `ExceptionController` in favor of `ExceptionPanelController` * Marked all classes of the WebProfilerBundle as internal 4.3.0 diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php index d6bedd8f3962a..8650d289c6621 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php @@ -20,15 +20,14 @@ use Twig\Error\LoaderError; use Twig\Loader\ExistsLoaderInterface; -@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ExceptionController::class, ExceptionErrorController::class), E_USER_DEPRECATED); +@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 ExceptionErrorController instead. - * @internal since Symfony 4.4 + * @deprecated since Symfony 4.4, use the ExceptionPanelController instead. */ class ExceptionController { @@ -106,7 +105,7 @@ public function cssAction($token) $template = $this->getTemplate(); - if (!$this->templateExists($template, false)) { + if (!$this->templateExists($template)) { return new Response($this->errorRenderer->getStylesheet(), 200, ['Content-Type' => 'text/css']); } @@ -118,15 +117,8 @@ protected function getTemplate() return '@Twig/Exception/'.($this->debug ? 'exception' : 'error').'.html.twig'; } - /** - * @deprecated since Symfony 4.4 - */ - protected function templateExists($template/*, bool $triggerDeprecation = true */) + protected function templateExists($template) { - if (1 === \func_num_args()) { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use the "exists()" method of the Twig loader instead.', __METHOD__), E_USER_DEPRECATED); - } - $loader = $this->twig->getLoader(); if ($loader instanceof ExistsLoaderInterface) { return $loader->exists($template); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionErrorController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionPanelController.php similarity index 91% rename from src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionErrorController.php rename to src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionPanelController.php index c0833067cf013..cff1f39400c16 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionErrorController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionPanelController.php @@ -20,8 +20,10 @@ * Renders the exception panel. * * @author Yonel Ceruto + * + * @internal */ -class ExceptionErrorController +class ExceptionPanelController { private $htmlErrorRenderer; private $profiler; @@ -46,7 +48,7 @@ public function body(string $token): Response ->getException() ; - return new Response($this->htmlErrorRenderer->getBody($exception)); + return new Response($this->htmlErrorRenderer->getBody($exception), 200, ['Content-Type' => 'text/html']); } /** @@ -54,6 +56,6 @@ public function body(string $token): Response */ public function stylesheet(): Response { - return new Response($this->htmlErrorRenderer->getStylesheet()); + return new Response($this->htmlErrorRenderer->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 962e1418bd131..0d68bf00b04c6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml @@ -28,10 +28,10 @@ %kernel.debug% - The "%service_id%" service is deprecated since Symfony 4.4, use the "web_profiler.controller.exception_error" service instead. + The "%service_id%" service is deprecated since Symfony 4.4, use the "web_profiler.controller.exception_panel" service instead. - + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml index 0eb4ea72ff33a..f20cba0e673f9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml @@ -37,11 +37,11 @@ - web_profiler.controller.exception_error::body + web_profiler.controller.exception_panel::body - web_profiler.controller.exception_error::stylesheet + web_profiler.controller.exception_panel::stylesheet