Total Complexity | 3 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | final class CompositeProvider implements ListenerProviderInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var ListenerProviderInterface[] |
||
16 | */ |
||
17 | private array $providers = []; |
||
18 | |||
19 | 1 | public function getListenersForEvent(object $event): iterable |
|
20 | { |
||
21 | 1 | foreach ($this->providers as $provider) { |
|
22 | 1 | yield from $provider->getListenersForEvent($event); |
|
23 | } |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Adds provider as a source for event listeners. |
||
28 | */ |
||
29 | 1 | public function attach(ListenerProviderInterface $provider): void |
|
32 | } |
||
33 | } |
||
34 |