Event emitter component.
$ composer install socketio-php/emitter
➜ emitter git:(master) ✗ php vendor/bin/phpunit tests/EmitterTest.php
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
.......... 10 / 10 (100%)
Time: 24 ms, Memory: 4.00 MB
OK (10 tests, 10 assertions)Register an event handler fn.
Register a single-shot event handler fn,
removed immediately after it is invoked the
first time.
- Pass
eventandfnto remove a listener. - Pass
eventto remove all listeners on that event. - Pass nothing to remove all listeners on all events.
Emit an event with variable option args.
Return an array of callbacks, or an empty array.
Check if this emitter has event handlers.
MIT