| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 45 | public static function dispatch(EventDispatcherInterface $eventDispatcher = null, string $eventName, BaseEvent $event): ?BaseEvent { |
|
| 35 | |||
| 36 | 45 | if (null === $eventDispatcher || false === $eventDispatcher->hasListeners($eventName)) { |
|
| 37 | 18 | return null; |
|
| 38 | } |
||
| 39 | |||
| 40 | 27 | if (Kernel::VERSION_ID < 40300) { |
|
| 41 | 9 | return $eventDispatcher->dispatch($eventName, $event); |
|
| 42 | } |
||
| 43 | |||
| 44 | 18 | return $eventDispatcher->dispatch($event, $eventName); |
|
| 45 | } |
||
| 46 | } |
||
| 47 |