1 | <?php |
||
7 | trait EventEmitterTrait |
||
8 | { |
||
9 | /** |
||
10 | * @var EventEmitterInterface |
||
11 | */ |
||
12 | protected $emitter; |
||
13 | |||
14 | /** |
||
15 | * @param LoopInterface $loop |
||
16 | */ |
||
17 | 39 | public function __construct(LoopInterface $loop = null) |
|
28 | |||
29 | /** |
||
30 | * |
||
31 | */ |
||
32 | 10 | public function __destruct() |
|
36 | |||
37 | /** |
||
38 | * @see EventEmitterInterface::setMode |
||
39 | */ |
||
40 | 10 | public function setMode($emitterMode) |
|
44 | |||
45 | /** |
||
46 | * @see EventEmitterInterface::getMode |
||
47 | */ |
||
48 | 2 | public function getMode() |
|
52 | |||
53 | /** |
||
54 | * @see EventEmitterInterface::on |
||
55 | */ |
||
56 | 46 | public function on($event, callable $listener) |
|
62 | |||
63 | /** |
||
64 | * @see EventEmitterInterface::once |
||
65 | */ |
||
66 | 6 | public function once($event, callable $listener) |
|
72 | |||
73 | /** |
||
74 | * @see EventEmitterInterface::times |
||
75 | */ |
||
76 | 6 | public function times($event, $limit, callable $listener) |
|
82 | |||
83 | /** |
||
84 | * @see EventEmitterInterface::delay |
||
85 | */ |
||
86 | 4 | public function delay($event, $ticks, callable $listener) |
|
92 | |||
93 | /** |
||
94 | * @see EventEmitterInterface::delayOnce |
||
95 | */ |
||
96 | 4 | public function delayOnce($event, $ticks, callable $listener) |
|
102 | |||
103 | /** |
||
104 | * @see EventEmitterInterface::delayTimes |
||
105 | */ |
||
106 | 4 | public function delayTimes($event, $ticks, $limit, callable $listener) |
|
112 | |||
113 | /** |
||
114 | * @see EventEmitterInterface::removeListener |
||
115 | */ |
||
116 | 8 | public function removeListener($event, callable $listener) |
|
123 | |||
124 | /** |
||
125 | * @see EventEmitterInterface::removeListeners |
||
126 | */ |
||
127 | 4 | public function removeListeners($event) |
|
134 | |||
135 | /** |
||
136 | * @see EventEmitterInterface::flushListeners |
||
137 | */ |
||
138 | 2 | public function flushListeners() |
|
145 | |||
146 | /** |
||
147 | * @see EventEmitterInterface::findListener |
||
148 | */ |
||
149 | 2 | public function findListener($event, callable $listener) |
|
153 | |||
154 | /** |
||
155 | * @see EventEmitterInterface::emit |
||
156 | */ |
||
157 | 66 | public function emit($event, $arguments = []) |
|
161 | |||
162 | /** |
||
163 | * @see EventEmitterInterface::copyEvent |
||
164 | */ |
||
165 | 2 | public function copyEvent(EventEmitterInterface $emitter, $event) |
|
169 | |||
170 | /** |
||
171 | * @see EventEmitterInterface::copyEvents |
||
172 | */ |
||
173 | 2 | public function copyEvents(EventEmitterInterface $emitter, $events) |
|
177 | |||
178 | /** |
||
179 | * @see EventEmitterInterface::forwardEvents |
||
180 | */ |
||
181 | 12 | public function forwardEvents(EventEmitterInterface $emitter) |
|
185 | |||
186 | /** |
||
187 | * @see EventEmitterInterface::discardEvents |
||
188 | */ |
||
189 | 4 | public function discardEvents(EventEmitterInterface $emitter) |
|
193 | } |