| 1 | <?php |
||
| 7 | abstract class ListenerAbstract implements ListenerInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var Event |
||
| 11 | */ |
||
| 12 | protected $event; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Call this on trigger event. Method should create object instance and call handle. |
||
| 16 | * |
||
| 17 | * @param Event $event |
||
| 18 | */ |
||
| 19 | public static function on($event) |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Return priority |
||
| 28 | * |
||
| 29 | * @return int |
||
| 30 | */ |
||
| 31 | public static function priority(): int |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Call on event method |
||
| 38 | * |
||
| 39 | * @param $event |
||
| 40 | */ |
||
| 41 | abstract public function handle($event); |
||
| 42 | } |
||
| 43 |