Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
58 | 4 | public function emit(Event $event) |
|
59 | { |
||
60 | 4 | if ($this->enabled === false) { |
|
61 | 1 | return $this; |
|
62 | } |
||
63 | |||
64 | /** @var callable[] $listeners */ |
||
65 | 3 | $listeners = $this->bindings[$event->getEventName()] ?? []; |
|
66 | |||
67 | 3 | foreach ($listeners as $listener) { |
|
68 | 3 | $listener($event); |
|
69 | } |
||
70 | |||
71 | 3 | return $this; |
|
72 | } |
||
73 | |||
86 |