Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ba24a51

Browse filesBrowse files
committed
Rename the new exception controller and mark it as internal
1 parent f6e93de commit ba24a51
Copy full SHA for ba24a51

File tree

5 files changed

+14
-20
lines changed
Filter options

5 files changed

+14
-20
lines changed

‎src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CHANGELOG
77
* Added button to clear the ajax request tab
88
* Deprecated the `ExceptionController::templateExists()` method
99
* Deprecated the `TemplateManager::templateExists()` method
10-
* Deprecated the `ExceptionController` in favor of `ExceptionErrorController`
10+
* Deprecated the `ExceptionController` in favor of `ExceptionPanelController`
1111
* Marked all classes of the WebProfilerBundle as internal
1212

1313
4.3.0

‎src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php
+4-12Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@
2020
use Twig\Error\LoaderError;
2121
use Twig\Loader\ExistsLoaderInterface;
2222

23-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ExceptionController::class, ExceptionErrorController::class), E_USER_DEPRECATED);
23+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ExceptionController::class, ExceptionPanelController::class), E_USER_DEPRECATED);
2424

2525
/**
2626
* ExceptionController.
2727
*
2828
* @author Fabien Potencier <fabien@symfony.com>
2929
*
30-
* @deprecated since Symfony 4.4, use the ExceptionErrorController instead.
31-
* @internal since Symfony 4.4
30+
* @deprecated since Symfony 4.4, use the ExceptionPanelController instead.
3231
*/
3332
class ExceptionController
3433
{
@@ -106,7 +105,7 @@ public function cssAction($token)
106105

107106
$template = $this->getTemplate();
108107

109-
if (!$this->templateExists($template, false)) {
108+
if (!$this->templateExists($template)) {
110109
return new Response($this->errorRenderer->getStylesheet(), 200, ['Content-Type' => 'text/css']);
111110
}
112111

@@ -118,15 +117,8 @@ protected function getTemplate()
118117
return '@Twig/Exception/'.($this->debug ? 'exception' : 'error').'.html.twig';
119118
}
120119

121-
/**
122-
* @deprecated since Symfony 4.4
123-
*/
124-
protected function templateExists($template/*, bool $triggerDeprecation = true */)
120+
protected function templateExists($template)
125121
{
126-
if (1 === \func_num_args()) {
127-
@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);
128-
}
129-
130122
$loader = $this->twig->getLoader();
131123
if ($loader instanceof ExistsLoaderInterface) {
132124
return $loader->exists($template);

‎src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionErrorController.php renamed to ‎src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionPanelController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionPanelController.php
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
* Renders the exception panel.
2121
*
2222
* @author Yonel Ceruto <yonelceruto@gmail.com>
23+
*
24+
* @internal
2325
*/
24-
class ExceptionErrorController
26+
class ExceptionPanelController
2527
{
2628
private $htmlErrorRenderer;
2729
private $profiler;
@@ -46,14 +48,14 @@ public function body(string $token): Response
4648
->getException()
4749
;
4850

49-
return new Response($this->htmlErrorRenderer->getBody($exception));
51+
return new Response($this->htmlErrorRenderer->getBody($exception), 200, ['Content-Type' => 'text/html']);
5052
}
5153

5254
/**
5355
* Renders the exception panel stylesheet.
5456
*/
5557
public function stylesheet(): Response
5658
{
57-
return new Response($this->htmlErrorRenderer->getStylesheet());
59+
return new Response($this->htmlErrorRenderer->getStylesheet(), 200, ['Content-Type' => 'text/css']);
5860
}
5961
}

‎src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
<argument>%kernel.debug%</argument>
2929
<argument type="service" id="debug.file_link_formatter" />
3030
<argument type="service" id="error_renderer.renderer.html" />
31-
<deprecated>The "%service_id%" service is deprecated since Symfony 4.4, use the "web_profiler.controller.exception_error" service instead.</deprecated>
31+
<deprecated>The "%service_id%" service is deprecated since Symfony 4.4, use the "web_profiler.controller.exception_panel" service instead.</deprecated>
3232
</service>
3333

34-
<service id="web_profiler.controller.exception_error" class="Symfony\Bundle\WebProfilerBundle\Controller\ExceptionErrorController" public="true">
34+
<service id="web_profiler.controller.exception_panel" class="Symfony\Bundle\WebProfilerBundle\Controller\ExceptionPanelController" public="true">
3535
<argument type="service" id="error_renderer.renderer.html" />
3636
<argument type="service" id="profiler" on-invalid="null" />
3737
</service>

‎src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
</route>
3838

3939
<route id="_profiler_exception" path="/{token}/exception">
40-
<default key="_controller">web_profiler.controller.exception_error::body</default>
40+
<default key="_controller">web_profiler.controller.exception_panel::body</default>
4141
</route>
4242

4343
<route id="_profiler_exception_css" path="/{token}/exception.css">
44-
<default key="_controller">web_profiler.controller.exception_error::stylesheet</default>
44+
<default key="_controller">web_profiler.controller.exception_panel::stylesheet</default>
4545
</route>
4646

4747
</routes>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.