| Total Complexity | 5 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class CompositeDispatcher implements EventDispatcherInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var EventDispatcherInterface[] |
||
| 17 | */ |
||
| 18 | private array $dispatchers = []; |
||
| 19 | |||
| 20 | 2 | public function dispatch(object $event) |
|
| 21 | { |
||
| 22 | 2 | foreach ($this->dispatchers as $dispatcher) { |
|
| 23 | 2 | if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { |
|
| 24 | 1 | return $event; |
|
| 25 | } |
||
| 26 | 2 | $event = $dispatcher->dispatch($event); |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | return $event; |
|
| 30 | } |
||
| 31 | |||
| 32 | 2 | public function attach(EventDispatcherInterface $dispatcher): void |
|
| 35 | } |
||
| 36 | } |
||
| 37 |