devisr / events
Hooks-based events system, component of the Devisr Framework
    dev-master
    2018-06-12 21:35 UTC
Requires (Dev)
- phpunit/phpunit: ^7.2
 
This package is auto-updated.
Last update: 2025-10-13 14:44:48 UTC
README
Devisr Events is a hooks-based events library to help with plugin systems.
To listen to an event:
    Events::listen("event.name", function($arguments) {
        // do stuff here
        return [ 1, 2, 3 ]; // optionally pass new arguments to the event target
    });
To create and invoke an event:
    (new Event("event.name", function($arguments) {
        // default event actions go here
        return 1; // optionally pass a value to the event.name:end event 
    }))($arguments) // pass default event arguments