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 4f50290

Browse filesBrowse files
94nonijaviereguiluz
authored andcommitted
feat: swap from event constant to event class
1 parent a8a4523 commit 4f50290
Copy full SHA for 4f50290

File tree

Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed

‎event_dispatcher.rst

Copy file name to clipboardExpand all lines: event_dispatcher.rst
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,22 +246,21 @@ methods could be called before or after the methods defined in other listeners
246246
and subscribers. To learn more about event subscribers, read :doc:`/components/event_dispatcher`.
247247

248248
The following example shows an event subscriber that defines several methods which
249-
listen to the same ``kernel.exception`` event::
249+
listen to the same ``kernel.exception`` event which has an ``ExceptionEvent``::
250250

251251
// src/EventSubscriber/ExceptionSubscriber.php
252252
namespace App\EventSubscriber;
253253

254254
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
255255
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
256-
use Symfony\Component\HttpKernel\KernelEvents;
257256

258257
class ExceptionSubscriber implements EventSubscriberInterface
259258
{
260259
public static function getSubscribedEvents(): array
261260
{
262261
// return the subscribed events, their methods and priorities
263262
return [
264-
KernelEvents::EXCEPTION => [
263+
ExceptionEvent::class => [
265264
['processException', 10],
266265
['logException', 0],
267266
['notifyException', -10],

0 commit comments

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