Registry / other / symfony-event-dispatcher

symfony-event-dispatcher

JSON →
library8.1.0phppackagistunverified

Provides tools that allow your application components to communicate with each other by dispatching events and listening to them.

composer require symfony/event-dispatcher
INSTALL
IMPORT
SIG · SYMFONY-EVENT-DISP
S
symfony-event-dispatcher
otherphpv8.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EventDispatcher
use Symfony\Component\EventDispatcher\EventDispatcher;

Creates an EventDispatcher, registers a listener, and dispatches an event.

use Symfony\Component\EventDispatcher\EventDispatcher; $dispatcher = new EventDispatcher(); $dispatcher->addListener('user.registered', function ($event) { echo 'User registered!'; }); $dispatcher->dispatch(new \Symfony\Contracts\EventDispatcher\Event(), 'user.registered');
Debug
Known issues
breakingEvent class must implement or extend Symfony\Contracts\EventDispatcher\Event in Symfony 4.3+
fix
Use Symfony\Contracts\EventDispatcher\Event as base class for custom events.
affects: >=4.3
Upgrade
Version history
8.1.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Amazon
1
Resources
symfony-event-dispatcher — pip install symfony-event-dispatcher · libregistry