Event
class Event
Event listener.
Properties
protected Container | $container | Container. | |
protected array | $events | Registered event listeners. |
Methods
Returns TRUE if an event listener is registered for the event and FALSE if not.
Returns an array of all registered events.
Clears all events handlers for the specified event.
Executes a closure handler and returns the response.
Resolves a class handler.
Executes a class handler and returns the response.
Executes the event handler and returns the response.
Runs all closures for an event and returns an array contaning the return values of each event handler.
Details
at line 41
__construct(Container|null $container = null)
Constructor.
at line 52
register(string $name, string|Closure $handler)
Registers an event handler.
at line 63
bool
has(string $name)
Returns TRUE if an event listener is registered for the event and FALSE if not.
at line 73
array
events()
Returns an array of all registered events.
at line 83
clear(string $name)
Clears all events handlers for the specified event.
at line 94
override(string $name, string|Closure $handler)
Overrides an event.
at line 108
protected mixed
executeClosureHandler(Closure $handler, array $parameters)
Executes a closure handler and returns the response.
at line 119
protected EventHandlerInterface
resolveHandler(string $handler)
Resolves a class handler.
at line 131
protected mixed
executeClassHandler(EventHandlerInterface $handler, array $parameters)
Executes a class handler and returns the response.
at line 143
protected mixed
executeHandler(string|Closure $handler, array $parameters)
Executes the event handler and returns the response.
at line 164
array
trigger(string $name, array $parameters = [], bool $break = false)
Runs all closures for an event and returns an array contaning the return values of each event handler.