File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -246,22 +246,22 @@ methods could be called before or after the methods defined in other listeners
246
246
and subscribers. To learn more about event subscribers, read :doc: `/components/event_dispatcher `.
247
247
248
248
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::
250
251
251
252
// src/EventSubscriber/ExceptionSubscriber.php
252
253
namespace App\E ventSubscriber;
253
254
254
255
use Symfony\C omponent\E ventDispatcher\E ventSubscriberInterface;
255
256
use Symfony\C omponent\H ttpKernel\E vent\E xceptionEvent;
256
- use Symfony\Component\HttpKernel\KernelEvents;
257
257
258
258
class ExceptionSubscriber implements EventSubscriberInterface
259
259
{
260
260
public static function getSubscribedEvents(): array
261
261
{
262
262
// return the subscribed events, their methods and priorities
263
263
return [
264
- KernelEvents::EXCEPTION => [
264
+ ExceptionEvent::class => [
265
265
['processException', 10],
266
266
['logException', 0],
267
267
['notifyException', -10],
You can’t perform that action at this time.
0 commit comments