The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Versions:

Getting Started

Events

Listeners

Generator

Callable Listeners

Any argument which satisfies the callable type-hint is accepted.

<?php

$emitter->addListener('event.name', function ($event) {
   // Handle the event.
});
// Or better:
$emitter->addListener('event.name', CallbackListener::fromCallable(function () {
    // Handle the event.
}));