1 | <?php |
||
17 | class ViewReferenceSubscriber implements \Doctrine\Common\EventSubscriber |
||
18 | { |
||
19 | protected $businessPageBuilder; |
||
20 | protected $viewReferenceProvider; |
||
21 | protected $viewReferenceHelper; |
||
22 | protected $dispatcher; |
||
23 | |||
24 | /** |
||
25 | * ViewReferenceSubscriber constructor. |
||
26 | * |
||
27 | * @param EventDispatcherInterface $dispatcher |
||
28 | */ |
||
29 | public function __construct(EventDispatcherInterface $dispatcher) |
||
33 | |||
34 | /** |
||
35 | * @return string[] |
||
36 | */ |
||
37 | public function getSubscribedEvents() |
||
45 | |||
46 | /** |
||
47 | * @param LifecycleEventArgs $eventArgs |
||
48 | */ |
||
49 | public function postUpdate(LifecycleEventArgs $eventArgs) |
||
53 | |||
54 | /** |
||
55 | * @param LifecycleEventArgs $eventArgs |
||
56 | */ |
||
57 | public function postPersist(LifecycleEventArgs $eventArgs) |
||
61 | |||
62 | /** |
||
63 | * @param LifecycleEventArgs $eventArgs |
||
64 | */ |
||
65 | public function preRemove(LifecycleEventArgs $eventArgs) |
||
74 | |||
75 | /** |
||
76 | * This method dispatch the event that the view must be build/rebuild. |
||
77 | * |
||
78 | * @param LifecycleEventArgs $eventArgs |
||
79 | */ |
||
80 | private function updateViewReference(LifecycleEventArgs $eventArgs) |
||
100 | } |
||
101 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: