1 | <?php |
||
23 | class ExceptionListener implements EventSubscriberInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var \Twig_Environment |
||
27 | */ |
||
28 | private $twig; |
||
29 | |||
30 | /** |
||
31 | * @var Context |
||
32 | */ |
||
33 | protected $requestContext; |
||
34 | |||
35 | /** |
||
36 | * ExceptionListener constructor. |
||
37 | */ |
||
38 | public function __construct(\Twig_Environment $twig, Context $requestContext) |
||
43 | |||
44 | public function onKernelException(GetResponseForExceptionEvent $event) |
||
95 | |||
96 | /** |
||
97 | * Returns an array of event names this subscriber wants to listen to. |
||
98 | * |
||
99 | * The array keys are event names and the value can be: |
||
100 | * |
||
101 | * * The method name to call (priority defaults to 0) |
||
102 | * * An array composed of the method name to call and the priority |
||
103 | * * An array of arrays composed of the method names to call and respective |
||
104 | * priorities, or 0 if unset |
||
105 | * |
||
106 | * For instance: |
||
107 | * |
||
108 | * * array('eventName' => 'methodName') |
||
109 | * * array('eventName' => array('methodName', $priority)) |
||
110 | * * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) |
||
111 | * |
||
112 | * @return array The event names to listen to |
||
113 | */ |
||
114 | public static function getSubscribedEvents() |
||
120 | } |
||
121 |