src/EventSubscriber/ExceptionSubscriber.php line 39

  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: FogaPC
  5.  * Date: 20/12/2017
  6.  * Time: 08:23
  7.  */
  8. namespace App\EventSubscriber;
  9. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  10. use Symfony\Component\HttpKernel\Event\ExceptionEvent;
  11. use Symfony\Component\HttpKernel\KernelEvents;
  12. class ExceptionSubscriber implements EventSubscriberInterface
  13. {
  14.     public static function getSubscribedEvents(): array
  15.     {
  16.         // return the subscribed events, their methods and priorities
  17.         return array(
  18.             KernelEvents::EXCEPTION => array(
  19.                 array('processException'10),
  20.                 array('logException'0),
  21.                 array('notifyException', -10),
  22.             )
  23.         );
  24.     }
  25.     public function processException(ExceptionEvent $event)
  26.     {
  27.         // ...
  28.     }
  29.     public function logException(ExceptionEvent $event)
  30.     {
  31.         // ...
  32.     }
  33.     public function notifyException(ExceptionEvent $event)
  34.     {
  35.         // ...
  36.     }
  37. }