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 b549dce

Browse filesBrowse files
committed
Merge branch '6.4' into 7.2
* 6.4: Minor tweak feat: swap from event constant to event class
2 parents 0d3d235 + a6e0879 commit b549dce
Copy full SHA for b549dce

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+3
-3
lines changed

‎event_dispatcher.rst

Copy file name to clipboardExpand all lines: event_dispatcher.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,22 +246,22 @@ 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 :ref:`kernel.exception event <component-http-kernel-kernel-exception>`_
250+
via its ``ExceptionEvent`` class::
250251

251252
// src/EventSubscriber/ExceptionSubscriber.php
252253
namespace App\EventSubscriber;
253254

254255
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
255256
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
256-
use Symfony\Component\HttpKernel\KernelEvents;
257257

258258
class ExceptionSubscriber implements EventSubscriberInterface
259259
{
260260
public static function getSubscribedEvents(): array
261261
{
262262
// return the subscribed events, their methods and priorities
263263
return [
264-
KernelEvents::EXCEPTION => [
264+
ExceptionEvent::class => [
265265
['processException', 10],
266266
['logException', 0],
267267
['notifyException', -10],

0 commit comments

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