Total Complexity | 3 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class EventDispatcher |
||
16 | { |
||
17 | public function __construct( |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Emit an event |
||
24 | * |
||
25 | * @psalm-suppress TooManyArguments |
||
26 | */ |
||
27 | public function dispatch(string $event, mixed $payload = null): void |
||
28 | { |
||
29 | $this->eventDispatcher->emit($event, $payload); |
||
30 | } |
||
31 | |||
32 | public function subscribeTo(string $event, callable $listener): void |
||
35 | } |
||
36 | } |
||
37 |