Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
8 | class Mediator |
||
9 | { |
||
10 | /** @var ListenerInterface[] */ |
||
11 | private $listeners = []; |
||
12 | |||
13 | /** |
||
14 | * @return ListenerInterface[] |
||
15 | */ |
||
16 | public function getListeners(): array |
||
17 | { |
||
18 | return $this->listeners; |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * @param ListenerInterface $listener |
||
23 | * @return Mediator |
||
24 | */ |
||
25 | public function addListener(ListenerInterface $listener): self |
||
26 | { |
||
27 | $this->listeners[] = $listener; |
||
28 | |||
29 | return $this; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param ListenerInterface $listener |
||
34 | * @return Mediator |
||
35 | */ |
||
36 | public function removeListener(ListenerInterface $listener): self |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @param EventInterface $event |
||
47 | */ |
||
48 | public function notify(EventInterface $event) |
||
52 | } |
||
53 | } |
||
56 |