@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | final class EventNameResolver implements EventNameResolverInterface |
| 8 | 8 | { |
| 9 | - public function resolveEventName(string|object $event): string |
|
| 9 | + public function resolveEventName(string | object $event): string |
|
| 10 | 10 | { |
| 11 | 11 | if (is_string($event)) { |
| 12 | 12 | return $event; |
@@ -11,5 +11,5 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * @throws EventNameResolverException If the provided $event is not a string or object. |
| 13 | 13 | */ |
| 14 | - public function resolveEventName(string|object $event): string; |
|
| 14 | + public function resolveEventName(string | object $event): string; |
|
| 15 | 15 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * @throws EventListenerException |
| 20 | 20 | */ |
| 21 | - public function addListenerForEvent(object|string $event, callable $listener, int $priority = 1): void |
|
| 21 | + public function addListenerForEvent(object | string $event, callable $listener, int $priority = 1): void |
|
| 22 | 22 | { |
| 23 | 23 | $this->listenerProvider->addListenerForEvent($event, $listener, $priority); |
| 24 | 24 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * @throws EventListenerException |
| 28 | 28 | */ |
| 29 | - public function addListenersForEvent(string|object $event, iterable $listeners, int $priority = 1): void |
|
| 29 | + public function addListenersForEvent(string | object $event, iterable $listeners, int $priority = 1): void |
|
| 30 | 30 | { |
| 31 | 31 | $this->listenerProvider->addListenersForEvent($event, $listeners, $priority); |
| 32 | 32 | } |
@@ -11,10 +11,10 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * @throws EventListenerException |
| 13 | 13 | */ |
| 14 | - public function addListenerForEvent(object|string $event, callable $listener, int $priority = 1): void; |
|
| 14 | + public function addListenerForEvent(object | string $event, callable $listener, int $priority = 1): void; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * @throws EventListenerException |
| 18 | 18 | */ |
| 19 | - public function addListenersForEvent(object|string $event, iterable $listeners, int $priority = 1): void; |
|
| 19 | + public function addListenersForEvent(object | string $event, iterable $listeners, int $priority = 1): void; |
|
| 20 | 20 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | private string $listenerMethodName = '__invoke'; |
| 16 | 16 | |
| 17 | 17 | public function __construct( |
| 18 | - callable|object $factory, |
|
| 18 | + callable | object $factory, |
|
| 19 | 19 | ?string $factoryMethodName = null, |
| 20 | 20 | ?string $listenerMethodName = null, |
| 21 | 21 | ) { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * @throws EventListenerException |
| 38 | 38 | */ |
| 39 | - public function addListenerForEvent(object|string $event, callable $listener, int $priority = 1): void |
|
| 39 | + public function addListenerForEvent(object | string $event, callable $listener, int $priority = 1): void |
|
| 40 | 40 | { |
| 41 | 41 | $this->getOrCreateListenerCollection($event)->addListener($listener, $priority); |
| 42 | 42 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | /** |
| 45 | 45 | * @throws EventListenerException If the $event name cannot be resolved. |
| 46 | 46 | */ |
| 47 | - public function addListenersForEvent(object|string $event, iterable $listeners, int $priority = 1): void |
|
| 47 | + public function addListenersForEvent(object | string $event, iterable $listeners, int $priority = 1): void |
|
| 48 | 48 | { |
| 49 | 49 | $this->getOrCreateListenerCollection($event)->addListeners($listeners, $priority); |
| 50 | 50 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | /** |
| 63 | 63 | * @throws EventListenerException |
| 64 | 64 | */ |
| 65 | - private function getOrCreateListenerCollection(string|object $event): ListenerCollectionInterface |
|
| 65 | + private function getOrCreateListenerCollection(string | object $event): ListenerCollectionInterface |
|
| 66 | 66 | { |
| 67 | 67 | try { |
| 68 | 68 | $eventName = $this->eventNameResolver->resolveEventName($event); |