mini\Hooks\Dispatcher abstract class

Documentation

Abstract event dispatcher - root class for Mini's hooks system

Properties (10)

private static int $queueFirstIndex
private static int $queueLastIndex
private static array $queuedListeners
private static array $queuedArgs
private static array $queuedDispatchers
private array $constructTrace

Stack trace of where this event dispatcher was constructed

private static ?Closure $exceptionHandler

Closure invoked whenever an event listener throws an exception

private static ?Closure $deferFunction

Closure which schedules a function to be invoked asynchronously

private static ?Closure $runEventsFunction

Closure which runs all scheduled events

private readonly ?string $description

Methods (12)

Documentation missing

Get a description of the event dispatcher

Get the filename where this event dispatcher was created

Get the line number where this event dispatcher was created

Configure event loop integration

Invoke all listeners in an array

Handle an exception from a listener

Filter array to remove specific values

Schedule a function to run when runEvents() is called

Run all scheduled events

Remove values from multiple arrays by reference

Invoke a listener with exception handling

Source

src/Hooks/Dispatcher.php:13-239