mini\Hooks\PerItemTriggers class

Documentation

Event dispatcher that triggers once per source (string or object) After triggering for a source, new subscribers are called immediately

Inheritance

Extends: mini\Hooks\Dispatcher

Properties (5)

protected array $triggeredStrings

String sources that triggered

protected readonly WeakMap $triggeredObjects

Object sources that triggered

protected array $stringListeners

Listeners on string sources

protected readonly WeakMap $objectListeners

Listeners on object sources

protected array $listeners

Listeners on all events

Methods (17)

Documentation missing

Was this event triggered for a specific source?

Trigger event for a specific source

Subscribe to all events (receives source as first arg)

Subscribe to a specific source

Unsubscribe from event

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/PerItemTriggers.php:16-182