| 1 | <?php |
||
| 9 | trait EventsEmitter |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var Emitter |
||
| 13 | */ |
||
| 14 | public static $events; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Boot events emitter. |
||
| 18 | */ |
||
| 19 | 8 | public function bootEvents() |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Emit event. |
||
| 26 | * |
||
| 27 | * @return \League\Event\EventInterface|string |
||
| 28 | */ |
||
| 29 | 4 | public static function emit() |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Emit event. |
||
| 36 | * |
||
| 37 | * @param string $event |
||
| 38 | * @param ListenerInterface|callable $listener |
||
| 39 | * @return EventInterface|string |
||
| 40 | */ |
||
| 41 | 1 | public static function on($event, $listener) |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Remove listeners. |
||
| 48 | * |
||
| 49 | * @param $event |
||
| 50 | */ |
||
| 51 | 1 | public static function off($event) |
|
| 55 | } |
||
| 56 |