1 | <?php |
||
25 | class ImageSubscriber implements EventSubscriberInterface |
||
26 | { |
||
27 | /** |
||
28 | * @var ImageManager |
||
29 | */ |
||
30 | private $imageManager; |
||
31 | |||
32 | /** |
||
33 | * ImageSubscriber constructor. |
||
34 | * |
||
35 | * @param ImageManager $imageManager |
||
36 | */ |
||
37 | public function __construct(ImageManager $imageManager) |
||
41 | |||
42 | /** |
||
43 | * @return array |
||
44 | */ |
||
45 | public static function getSubscribedEvents() |
||
53 | |||
54 | /** |
||
55 | * @param ImageEvent $event |
||
56 | */ |
||
57 | public function onImageCreated(ImageEvent $event) |
||
63 | |||
64 | /** |
||
65 | * @param ImageEvent $event |
||
66 | */ |
||
67 | public function onImageUpdated(ImageEvent $event) |
||
74 | |||
75 | /** |
||
76 | * @param ImageEvent $event |
||
77 | */ |
||
78 | public function onImageDeleted(ImageEvent $event) |
||
84 | } |
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: