src/EventSubscriber/ExceptionSubscriber.php line 33

Open in your IDE?
  1. <?php
  2. namespace App\EventSubscriber;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Symfony\Component\HttpKernel\Event\ExceptionEvent;
  5. use Symfony\Component\HttpKernel\KernelEvents;
  6. class ExceptionSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents()
  9.     {
  10.         // return the subscribed events, their methods and priorities
  11.         return [
  12.             KernelEvents::EXCEPTION => [
  13.                 ['processException'10],
  14.                 ['logException'0],
  15.                 ['notifyException', -10],
  16.             ],
  17.         ];
  18.     }
  19.     public function processException(ExceptionEvent $event)
  20.     {
  21.         // ...
  22.     }
  23.     public function logException(ExceptionEvent $event)
  24.     {
  25.         // ...
  26.     }
  27.     public function notifyException(ExceptionEvent $event)
  28.     {
  29.         // ...
  30.     }
  31. }