League Event compatibility layer for Symfony EventDispatcher.
Via Composer
$ composer require indigophp/league-event-compat
This package provides a wrapper for League Event by implementing EventDispatcherInterface
to replace Symfony EventDispatcher in your application. This way you can use your custom Domain Events and Listeners in packages which lock Symfony EventDispatcher in.
use League\Event\Compat\Symfony\EventDispatcher;
// You can optionally pass an EmitterInterface in the constructor
$eventDispatcher = new EventDispatcher;
// use $eventDispatcher as you would use the symfony one
// You can add your custom listeners which will receive an object implementing EventInterface
$eventDispatcher->getEmitter()->addListener(...);
// DON'T EMIT EVENTS MANUALLY WHICH HAVE SYMFONY LISTENERS
$eventDispatcher->getEmitter()->emit('symfony_event');
$ phpspec run
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.