| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class TestListener extends AbstractListener |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @return array |
||
| 13 | */ |
||
| 14 | public function getEventMapping(): array |
||
| 15 | { |
||
| 16 | return [ |
||
| 17 | PoolEvent::POOL_WAIT_TICK_PID_REMOVED => 'onTickRemoved', |
||
| 18 | TestEvent::EVENT_NAME => 'onTestEvent' |
||
| 19 | ]; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param PoolEvent $event |
||
| 24 | */ |
||
| 25 | public function onTickRemoved(PoolEvent $event) |
||
| 26 | { |
||
| 27 | echo $event->getThreadLeftNb() . PHP_EOL; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param TestEvent $event |
||
| 32 | */ |
||
| 33 | public function onTestEvent(TestEvent $event) |
||
| 36 | } |
||
| 37 | } |