super-simple / event-dispatcher
Super Simple Event Dispatcher library implementing the PSR-14 standard.
v1.2
2022-07-17 08:14 UTC
Requires
- php: >=8.1
- psr/event-dispatcher: ^1.0
Requires (Dev)
- phpunit/phpunit: >=9.0
README
A super simple event dispatcher library implementing PSR-14
Install
composer require super-simple/event-dispatcher
Requires PHP 8.1 or newer.
Usage
Basic usage:
require '/path/to/vendor/autoload.php'; // New provider $provider = new EventProvider(); // Register listener $provider->addListener($listener, $eventName, $priority); // New dispatcher $dispatcher = new EventDispatcher($provider); // Dispatch the event $dispatcher->dispatch($event);
For more details check out the wiki.