Observable class.
Allows to extend any struct with ability to Fire events and ability to listen for any events.
package |
Default |
---|
fire()
Executes callback functions and passes data to them.
off(string $event, callable $callback)
Use the callback function that you used when calling "on".
string
Event name
callable
Callback function that was used when calling "on"
on(string $event, callable $callback)
string
Event name
callable
function to be called when an event is "fire"
events : array
var |
---|
array
stub : array
Requires to avoid "Missing numbers of arguments" if callback function requires args, that were not passed to fire()
var |
---|
array