| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function on(string $eventName, callable $callable, int $priority = 100) |
||
| 28 | { |
||
| 29 | if (!isset($this->listeners[$eventName])) { |
||
| 30 | $this->listeners[$eventName] = []; |
||
| 31 | } |
||
| 32 | |||
| 33 | $this->listeners[$eventName][] = [$priority, $callable]; |
||
| 34 | \uasort($this->listeners[$eventName], function ($event1, $event2) { |
||
| 35 | return $event1[0] <=> $event2[0]; |
||
| 36 | }); |
||
| 55 |