@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | public static function getDefaultMethodName($eventName) |
39 | 39 | { |
40 | - return 'on' . str_replace(['_', '.'], '', $eventName); |
|
40 | + return 'on'.str_replace(['_', '.'], '', $eventName); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function addSubscriber(EventSubscriberInterface $subscriber): void |
61 | 61 | { |
62 | 62 | foreach ($subscriber->getSubscribedEvents() as $eventData) { |
63 | - if (!isset($eventData['event'])) { |
|
63 | + if ( ! isset($eventData['event'])) { |
|
64 | 64 | throw new InvalidArgumentException(sprintf('Each event must have a "event" key.')); |
65 | 65 | } |
66 | 66 | |
@@ -75,34 +75,34 @@ discard block |
||
75 | 75 | |
76 | 76 | public function hasListeners(string $eventName, string $class, string $format): bool |
77 | 77 | { |
78 | - if (!isset($this->listeners[$eventName])) { |
|
78 | + if ( ! isset($this->listeners[$eventName])) { |
|
79 | 79 | return false; |
80 | 80 | } |
81 | 81 | |
82 | - if (!isset($this->classListeners[$eventName][$class][$format])) { |
|
82 | + if ( ! isset($this->classListeners[$eventName][$class][$format])) { |
|
83 | 83 | $this->classListeners[$eventName][$class][$format] = $this->initializeListeners($eventName, $class, $format); |
84 | 84 | } |
85 | 85 | |
86 | - return !!$this->classListeners[$eventName][$class][$format]; |
|
86 | + return ! ! $this->classListeners[$eventName][$class][$format]; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | public function dispatch($eventName, string $class, string $format, Event $event): void |
90 | 90 | { |
91 | - if (!isset($this->listeners[$eventName])) { |
|
91 | + if ( ! isset($this->listeners[$eventName])) { |
|
92 | 92 | return; |
93 | 93 | } |
94 | 94 | |
95 | 95 | $object = $event instanceof ObjectEvent ? $event->getObject() : null; |
96 | 96 | $realClass = is_object($object) ? get_class($object) : ''; |
97 | - $objectClass = $realClass !== $class ? ($realClass . $class) : $class; |
|
97 | + $objectClass = $realClass !== $class ? ($realClass.$class) : $class; |
|
98 | 98 | |
99 | - if (!isset($this->classListeners[$eventName][$objectClass][$format])) { |
|
99 | + if ( ! isset($this->classListeners[$eventName][$objectClass][$format])) { |
|
100 | 100 | $this->classListeners[$eventName][$objectClass][$format] = $this->initializeListeners($eventName, $class, $format); |
101 | 101 | } |
102 | 102 | |
103 | 103 | foreach ($this->classListeners[$eventName][$objectClass][$format] as $listener) { |
104 | 104 | |
105 | - if ($listener[3] !== null && !($object instanceof $listener[3])) { |
|
105 | + if ($listener[3] !== null && ! ($object instanceof $listener[3])) { |
|
106 | 106 | continue; |
107 | 107 | } |
108 | 108 |