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 d0de558

Browse filesBrowse files
committed
minor #13391 Replace ExceptionListener uses with ErrorListener (APachecoDiSanti)
This PR was squashed before being merged into the master branch (closes #13391). Discussion ---------- Replace ExceptionListener uses with ErrorListener `ExceptionListener` has been deprecated in version 5.0 of `symfony/http-kernel`: https://github.com/symfony/http-kernel/blob/master/CHANGELOG.md The changelog recommends using `ErrorListener` instead. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- cbe6270 Replace ExceptionListener uses with ErrorListener
2 parents 1493ced + cbe6270 commit d0de558
Copy full SHA for d0de558

File tree

Expand file treeCollapse file tree

2 files changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-6
lines changed

‎create_framework/dependency_injection.rst

Copy file name to clipboardExpand all lines: create_framework/dependency_injection.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ to it::
2727
$argumentResolver = new HttpKernel\Controller\ArgumentResolver();
2828

2929
$dispatcher = new EventDispatcher();
30-
$dispatcher->addSubscriber(new HttpKernel\EventListener\ExceptionListener(
30+
$dispatcher->addSubscriber(new HttpKernel\EventListener\ErrorListener(
3131
'Calendar\Controller\ErrorController::exception'
3232
));
3333
$dispatcher->addSubscriber(new HttpKernel\EventListener\RouterListener($matcher, $requestStack));
@@ -124,7 +124,7 @@ Create a new file to host the dependency injection container configuration::
124124
$containerBuilder->register('listener.response', HttpKernel\EventListener\ResponseListener::class)
125125
->setArguments(['UTF-8'])
126126
;
127-
$containerBuilder->register('listener.exception', HttpKernel\EventListener\ExceptionListener::class)
127+
$containerBuilder->register('listener.exception', HttpKernel\EventListener\ErrorListener::class)
128128
->setArguments(['Calendar\Controller\ErrorController::exception'])
129129
;
130130
$containerBuilder->register('dispatcher', EventDispatcher\EventDispatcher::class)

‎create_framework/http_kernel_httpkernel_class.rst

Copy file name to clipboardExpand all lines: create_framework/http_kernel_httpkernel_class.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ framework: it matches the incoming request and populates the request
6666
attributes with route parameters.
6767

6868
Our code is now much more concise and surprisingly more robust and more
69-
powerful than ever. For instance, use the built-in ``ExceptionListener`` to
69+
powerful than ever. For instance, use the built-in ``ErrorListener`` to
7070
make your error management configurable::
7171

7272
$errorHandler = function (Symfony\Component\ErrorHandler\Exception\FlattenException $exception) {
7373
$msg = 'Something went wrong! ('.$exception->getMessage().')';
7474

7575
return new Response($msg, $exception->getStatusCode());
7676
};
77-
$dispatcher->addSubscriber(new HttpKernel\EventListener\ExceptionListener($errorHandler));
77+
$dispatcher->addSubscriber(new HttpKernel\EventListener\ErrorListener($errorHandler));
7878

79-
``ExceptionListener`` gives you a ``FlattenException`` instance instead of the
79+
``ErrorListener`` gives you a ``FlattenException`` instance instead of the
8080
thrown ``Exception`` or ``Error`` instance to ease exception manipulation and
8181
display. It can take any valid controller as an exception handler, so you can
8282
create an ErrorController class instead of using a Closure::
8383

84-
$listener = new HttpKernel\EventListener\ExceptionListener(
84+
$listener = new HttpKernel\EventListener\ErrorListener(
8585
'Calendar\Controller\ErrorController::exception'
8686
);
8787
$dispatcher->addSubscriber($listener);

0 commit comments

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