The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Versions:

Getting Started

Events

Listeners

Generator

Listener Providers

Listener providers allow for a class based listeners registration.

<?php

use League\Event\ListenerAcceptorInterface;
use League\Event\ListenerProviderInterface;

class MyProvider implements ListenerProviderInterface
{
    public function provideListeners(ListenerAcceptorInterface $acceptor)
    {
        $acceptor->addListener('event', new MyListeners);
    }
}

$emitter->useListenerProvider(new MyProvider);