Total Complexity | 5 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait EmitterAwarePolyfill |
||
10 | { |
||
11 | /** |
||
12 | * @var EventEmitter |
||
13 | */ |
||
14 | private $emitter; |
||
15 | |||
16 | public function getEmitter(): EventEmitter |
||
17 | { |
||
18 | if ( ! $this->emitter) { |
||
19 | $this->emitter = new EventEmitter(); |
||
20 | } |
||
21 | |||
22 | return $this->emitter; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return $this |
||
27 | */ |
||
28 | public function setEmitter(EventEmitter $emitter) |
||
33 | } |
||
34 | |||
35 | public function getEventDispatcher(): EventDispatcherInterface |
||
36 | { |
||
37 | return $this->getEmitter(); |
||
38 | } |
||
39 | |||
40 | public function getListenerRegistry(): ListenerRegistry |
||
43 | } |
||
44 | } |