Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb5b042

Browse files
ycerutonicolas-grekas
authored andcommitted
Rename ErrorCatcher to ErrorRenderer (rendering part only)
1 parent d3c17f2 commit fb5b042

File tree

51 files changed

+151
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+151
-150
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function load(array $configs, ContainerBuilder $container)
154154
$loader->load('web.xml');
155155
$loader->load('services.xml');
156156
$loader->load('fragment_renderer.xml');
157-
$loader->load('error_catcher.xml');
157+
$loader->load('error_renderer.xml');
158158

159159
if (interface_exists(PsrEventDispatcherInterface::class)) {
160160
$container->setAlias(PsrEventDispatcherInterface::class, 'event_dispatcher');

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
3434
use Symfony\Component\DependencyInjection\Compiler\RegisterReverseContainerPass;
3535
use Symfony\Component\DependencyInjection\ContainerBuilder;
36-
use Symfony\Component\ErrorCatcher\DependencyInjection\ErrorCatcherPass;
36+
use Symfony\Component\ErrorRenderer\DependencyInjection\ErrorRendererPass;
3737
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
3838
use Symfony\Component\Form\DependencyInjection\FormPass;
3939
use Symfony\Component\HttpFoundation\Request;
@@ -91,7 +91,7 @@ public function build(ContainerBuilder $container)
9191
KernelEvents::FINISH_REQUEST,
9292
];
9393

94-
$container->addCompilerPass(new ErrorCatcherPass());
94+
$container->addCompilerPass(new ErrorRendererPass());
9595
$container->addCompilerPass(new LoggerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
9696
$container->addCompilerPass(new RegisterControllerArgumentLocatorsPass());
9797
$container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING);

src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<argument type="service" id="debug.file_link_formatter" />
2323
<argument>%kernel.debug%</argument>
2424
<argument>%kernel.charset%</argument>
25-
<argument type="service" id="error_catcher.error_formatter" on-invalid="null" />
25+
<argument type="service" id="error_renderer" on-invalid="null" />
2626
</service>
2727

2828
<service id="debug.file_link_formatter" class="Symfony\Component\HttpKernel\Debug\FileLinkFormatter">

src/Symfony/Bundle/FrameworkBundle/Resources/config/error_catcher.xml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
6+
7+
<services>
8+
<service id="error_renderer" class="Symfony\Component\ErrorRenderer\DependencyInjection\LazyLoadingErrorRenderer">
9+
<argument /> <!-- error renderer locator -->
10+
</service>
11+
12+
<service id="error_renderer.renderer.html" class="Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer">
13+
<tag name="error_renderer.renderer" />
14+
<argument>%kernel.debug%</argument>
15+
<argument>%kernel.charset%</argument>
16+
<argument>%debug.file_link_format%</argument>
17+
</service>
18+
19+
<service id="error_renderer.renderer.json" class="Symfony\Component\ErrorRenderer\ErrorRenderer\JsonErrorRenderer">
20+
<tag name="error_renderer.renderer" />
21+
<argument>%kernel.debug%</argument>
22+
</service>
23+
24+
<service id="error_renderer.renderer.xml" class="Symfony\Component\ErrorRenderer\ErrorRenderer\XmlErrorRenderer">
25+
<tag name="error_renderer.renderer" format="atom" />
26+
<tag name="error_renderer.renderer" />
27+
<argument>%kernel.debug%</argument>
28+
<argument>%kernel.charset%</argument>
29+
</service>
30+
31+
<service id="error_renderer.renderer.txt" class="Symfony\Component\ErrorRenderer\ErrorRenderer\TxtErrorRenderer">
32+
<tag name="error_renderer.renderer" />
33+
<argument>%kernel.debug%</argument>
34+
<argument>%kernel.charset%</argument>
35+
</service>
36+
</services>
37+
</container>

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/cache": "^4.4|^5.0",
2222
"symfony/config": "^4.2|^5.0",
2323
"symfony/dependency-injection": "^4.4|^5.0",
24-
"symfony/error-catcher": "^4.4|^5.0",
24+
"symfony/error-renderer": "^4.4|^5.0",
2525
"symfony/http-foundation": "^4.3|^5.0",
2626
"symfony/http-kernel": "^4.4|^5.0",
2727
"symfony/polyfill-mbstring": "~1.0",

src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\TwigBundle\Controller;
1313

14-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
14+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpFoundation\Response;
1717
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;

src/Symfony/Bundle/TwigBundle/Controller/PreviewErrorController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\TwigBundle\Controller;
1313

14-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
14+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpKernel\HttpKernelInterface;
1717

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function process(ContainerBuilder $container)
2828
}
2929

3030
// register the exception controller only if Twig is enabled and required dependencies do exist
31-
if (!class_exists('Symfony\Component\ErrorCatcher\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) {
31+
if (!class_exists('Symfony\Component\ErrorRenderer\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) {
3232
$container->removeDefinition('twig.exception_listener');
3333
} elseif ($container->hasParameter('templating.engines')) {
3434
$engines = $container->getParameter('templating.engines');

src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Bundle\TwigBundle\Controller\ExceptionController;
1515
use Symfony\Bundle\TwigBundle\Tests\TestCase;
16-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
16+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1717
use Symfony\Component\HttpFoundation\Request;
1818
use Twig\Environment;
1919
use Twig\Loader\ArrayLoader;

src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Bundle\TwigBundle\Controller\PreviewErrorController;
1515
use Symfony\Bundle\TwigBundle\Tests\TestCase;
16-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
16+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1717
use Symfony\Component\HttpFoundation\Request;
1818
use Symfony\Component\HttpFoundation\Response;
1919
use Symfony\Component\HttpKernel\HttpKernelInterface;

src/Symfony/Bundle/TwigBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^7.1.3",
20-
"symfony/error-catcher": "^4.4|^5.0",
20+
"symfony/error-renderer": "^4.4|^5.0",
2121
"symfony/twig-bridge": "^4.4|^5.0",
2222
"symfony/http-foundation": "^4.3|^5.0",
2323
"symfony/http-kernel": "^4.4|^5.0",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\WebProfilerBundle\Controller;
1313

14-
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
14+
use Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer;
1515
use Symfony\Component\HttpFoundation\Response;
1616
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
1717
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<argument type="service" id="twig" />
2828
<argument>%kernel.debug%</argument>
2929
<argument type="service" id="debug.file_link_formatter" />
30-
<argument type="service" id="error_catcher.renderer.html" on-invalid="null" />
30+
<argument type="service" id="error_renderer.renderer.html" on-invalid="null" />
3131
</service>
3232

3333
<service id="web_profiler.csp.handler" class="Symfony\Bundle\WebProfilerBundle\Csp\ContentSecurityPolicyHandler">

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Symfony\Component\DependencyInjection\ContainerBuilder;
1818
use Symfony\Component\DependencyInjection\Definition;
1919
use Symfony\Component\DependencyInjection\Reference;
20-
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
20+
use Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer;
2121
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
2222
use Symfony\Component\EventDispatcher\EventDispatcher;
2323

@@ -54,7 +54,7 @@ protected function setUp()
5454
$this->kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\KernelInterface')->getMock();
5555

5656
$this->container = new ContainerBuilder();
57-
$this->container->register('error_catcher.renderer.html', HtmlErrorRenderer::class);
57+
$this->container->register('error_renderer.renderer.html', HtmlErrorRenderer::class);
5858
$this->container->register('event_dispatcher', EventDispatcher::class)->setPublic(true);
5959
$this->container->register('router', $this->getMockClass('Symfony\\Component\\Routing\\RouterInterface'))->setPublic(true);
6060
$this->container->register('twig', 'Twig\Environment')->setPublic(true);

src/Symfony/Component/Debug/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
4.4.0
55
-----
66

7-
* deprecated `FlattenException`, use the `FlattenException` of the `ErrorCatcher` component
7+
* deprecated `FlattenException`, use the `FlattenException` of the `ErrorRenderer` component
88

99
4.3.0
1010
-----

src/Symfony/Component/Debug/Exception/FlattenException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
1515
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
1616

17-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorCatcher\Exception\FlattenException" instead.', FlattenException::class), E_USER_DEPRECATED);
17+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorRenderer\Exception\FlattenException" instead.', FlattenException::class), E_USER_DEPRECATED);
1818

1919
/**
2020
* FlattenException wraps a PHP Error or Exception to be able to serialize it.
@@ -23,7 +23,7 @@
2323
*
2424
* @author Fabien Potencier <[email protected]>
2525
*
26-
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\FlattenException instead.
26+
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorRenderer\Exception\FlattenException instead.
2727
*/
2828
class FlattenException
2929
{
@@ -39,11 +39,11 @@ class FlattenException
3939
private $line;
4040

4141
/**
42-
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception::createFromThrowable() instead.
42+
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorRenderer\Exception::createFromThrowable() instead.
4343
*/
4444
public static function create(\Exception $exception, $statusCode = null, array $headers = [])
4545
{
46-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception::createFromThrowable() instead.', __METHOD__), E_USER_DEPRECATED);
46+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use Symfony\Component\ErrorRenderer\Exception::createFromThrowable() instead.', __METHOD__), E_USER_DEPRECATED);
4747

4848
return static::createFromThrowable($exception, $statusCode, $headers);
4949
}

src/Symfony/Component/ErrorCatcher/DependencyInjection/ErrorCatcherPass.php renamed to src/Symfony/Component/ErrorRenderer/DependencyInjection/ErrorRendererPass.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\DependencyInjection;
12+
namespace Symfony\Component\ErrorRenderer\DependencyInjection;
1313

1414
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1515
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\DependencyInjection\Reference;
18-
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRendererInterface;
18+
use Symfony\Component\ErrorRenderer\ErrorRenderer\ErrorRendererInterface;
1919

2020
/**
2121
* @author Yonel Ceruto <[email protected]>
2222
*/
23-
class ErrorCatcherPass implements CompilerPassInterface
23+
class ErrorRendererPass implements CompilerPassInterface
2424
{
2525
private $rendererService;
2626
private $rendererTag;
2727

28-
public function __construct(string $rendererService = 'error_catcher.error_formatter', string $rendererTag = 'error_catcher.renderer')
28+
public function __construct(string $rendererService = 'error_renderer', string $rendererTag = 'error_renderer.renderer')
2929
{
3030
$this->rendererService = $rendererService;
3131
$this->rendererTag = $rendererTag;

src/Symfony/Component/ErrorCatcher/DependencyInjection/LazyLoadingErrorFormatter.php renamed to src/Symfony/Component/ErrorRenderer/DependencyInjection/LazyLoadingErrorRenderer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\DependencyInjection;
12+
namespace Symfony\Component\ErrorRenderer\DependencyInjection;
1313

1414
use Psr\Container\ContainerInterface;
15-
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorFormatter;
15+
use Symfony\Component\ErrorRenderer\ErrorRenderer;
1616

1717
/**
1818
* Lazily loads error renderers from the dependency injection container.
1919
*
2020
* @author Yonel Ceruto <[email protected]>
2121
*/
22-
class LazyLoadingErrorFormatter extends ErrorFormatter
22+
class LazyLoadingErrorRenderer extends ErrorRenderer
2323
{
2424
private $container;
2525
private $initialized = [];

src/Symfony/Component/ErrorCatcher/ErrorRenderer/ErrorFormatter.php renamed to src/Symfony/Component/ErrorRenderer/ErrorRenderer.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
12+
namespace Symfony\Component\ErrorRenderer;
1313

14-
use Symfony\Component\ErrorCatcher\Exception\ErrorRendererNotFoundException;
15-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
14+
use Symfony\Component\ErrorRenderer\ErrorRenderer\ErrorRendererInterface;
15+
use Symfony\Component\ErrorRenderer\Exception\ErrorRendererNotFoundException;
16+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1617

1718
/**
1819
* Formats an exception to be used as response content.
@@ -23,7 +24,7 @@
2324
*
2425
* @author Yonel Ceruto <[email protected]>
2526
*/
26-
class ErrorFormatter
27+
class ErrorRenderer
2728
{
2829
private $renderers = [];
2930

src/Symfony/Component/ErrorCatcher/ErrorRenderer/ErrorRendererInterface.php renamed to src/Symfony/Component/ErrorRenderer/ErrorRenderer/ErrorRendererInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
12+
namespace Symfony\Component\ErrorRenderer\ErrorRenderer;
1313

14-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
14+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1515

1616
/**
1717
* Interface for classes that can render errors in a specific format.

src/Symfony/Component/ErrorCatcher/ErrorRenderer/HtmlErrorRenderer.php renamed to src/Symfony/Component/ErrorRenderer/ErrorRenderer/HtmlErrorRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
12+
namespace Symfony\Component\ErrorRenderer\ErrorRenderer;
1313

14-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
14+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1515
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
1616

1717
/**

src/Symfony/Component/ErrorCatcher/ErrorRenderer/JsonErrorRenderer.php renamed to src/Symfony/Component/ErrorRenderer/ErrorRenderer/JsonErrorRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
12+
namespace Symfony\Component\ErrorRenderer\ErrorRenderer;
1313

14-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
14+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1515

1616
/**
1717
* @author Yonel Ceruto <[email protected]>

src/Symfony/Component/ErrorCatcher/ErrorRenderer/TxtErrorRenderer.php renamed to src/Symfony/Component/ErrorRenderer/ErrorRenderer/TxtErrorRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
12+
namespace Symfony\Component\ErrorRenderer\ErrorRenderer;
1313

14-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
14+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1515

1616
/**
1717
* @author Yonel Ceruto <[email protected]>

src/Symfony/Component/ErrorCatcher/ErrorRenderer/XmlErrorRenderer.php renamed to src/Symfony/Component/ErrorRenderer/ErrorRenderer/XmlErrorRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
12+
namespace Symfony\Component\ErrorRenderer\ErrorRenderer;
1313

14-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
14+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
1515

1616
/**
1717
* @author Yonel Ceruto <[email protected]>

src/Symfony/Component/ErrorCatcher/Exception/ErrorRendererNotFoundException.php renamed to src/Symfony/Component/ErrorRenderer/Exception/ErrorRendererNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\ErrorCatcher\Exception;
12+
namespace Symfony\Component\ErrorRenderer\Exception;
1313

1414
class ErrorRendererNotFoundException extends \RuntimeException
1515
{

0 commit comments

Comments
 (0)