eleven-x / event
Event system
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/eleven-x/event
This package is not auto-updated.
Last update: 2025-12-21 02:56:05 UTC
README
Simple php event system
Install
composer require eleven-x/event
API
addListener($eventName, \Closure $listener, $priority = 0, $once = false)
Adds the listener function to the end of the listeners array for the event named $eventName
$eventNameevent name$listenerlistener function$priorityThe higher the value, the higher the priority$oncewhether it is a one-time
once($eventName, \Closure $listener)
Adds a one time listener function for the event named $eventName.
The next time $eventName is triggered, this listener is removed and then invoked.
$eventNameevent name$listenerlistener function
removeListener($eventName)
Removes the specified listener from the listener array for the event named $eventName.
$eventNameevent name
hasListeners($eventName)
Whether there is a listener
$eventNameevent name
dispatch($eventName, Event $event = null)
Calls each of the listeners registered for the event named $eventName
$eventNameevent name$eventEvent object
License
MIT