mulertech / event-manager
This package manage events in your application
Installs: 32
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mulertech/event-manager
Requires
- php: ^8.2
- psr/event-dispatcher: ^1
Requires (Dev)
- mulertech/docker-tests: ^1
- phpunit/phpunit: ^10|^11
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2025-09-27 09:29:43 UTC
README
The MulerTech EventManager package is a simple event manager that allows you to register and trigger events in your PHP application.
Installation
- Add to your "composer.json" file into require section:
"muler/event-manager": "^1.0"
and run the command:
php composer.phar update
- Run the command:
php composer.phar require muler/event-manager "^1.0"
Usage
Registering an event
use Muler\EventManager\EventManager; $eventManager = new EventManager(); $eventManager->addListener(new Listener()); // Into the class that calls the event $eventManager->dispatch(new Event());
Creating a listener
use Muler\EventManager\ListenerInterface; class Listener implements ListenerInterface { public function handle(Event $event) { // Do something } }