Skip to content

phpgears/event-symfony-event-dispatcher

Repository files navigation

PHP version Latest Version License

Build Status Style Check Code Quality Code Coverage

Total Downloads Monthly Downloads

Event bus Event Dispatcher

Event bus implementation with Symfony's Event Dispatcher

Installation

Composer

composer require phpgears/event-symfony-event-dispatcher

Usage

Require composer autoload file

require './vendor/autoload.php';

Events Bus

use Gears\Event\Symfony\Dispatcher\ContainerAwareDispatcher;
use Gears\Event\Symfony\Dispatcher\EventBus;
use Gears\Event\Symfony\Dispatcher\Dispatcher;

$eventToHandlerMap = [];

$symfonyDispatcher = new Dispatcher($eventToHandlerMap);
// OR
/** @var \Psr\Container\ContainerInterface $container */
$symfonyDispatcher = new ContainerAwareDispatcher($container, $eventToHandlerMap);

$eventBus = new EventBus($symfonyDispatcher);

/** @var \Gears\Event\Event $event */
$eventBus->dispatch($event);

Contributing

Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.

See file CONTRIBUTING.md

License

See file LICENSE included with the source code for a copy of the license terms.

About

IMPLEMENTATION - Event bus with Symfony's Event Dispatcher

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages