Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

indigophp/league-event-compat

Repository files navigation

League Event Compatibility

Latest Version Software License Build Status Code Coverage Quality Score HHVM Status Total Downloads

League Event compatibility layer for Symfony EventDispatcher.

Install

Via Composer

$ composer require indigophp/league-event-compat

Usage

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');

Testing

$ phpspec run

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

League Event compatibility layer for Symfony EventDispatcher

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages