Julio Montoya 7464887946 Updating vendors %!s(int64=11) %!d(string=hai) anos
..
Debug 32682a9ca8 Updating vendor %!s(int64=12) %!d(string=hai) anos
Tests 3d9752111b Updating vendor %!s(int64=11) %!d(string=hai) anos
CHANGELOG.md 32682a9ca8 Updating vendor %!s(int64=12) %!d(string=hai) anos
ContainerAwareEventDispatcher.php 8b76813307 Adding web profiler provider %!s(int64=12) %!d(string=hai) anos
Event.php 8b76813307 Adding web profiler provider %!s(int64=12) %!d(string=hai) anos
EventDispatcher.php 1ad9119c46 Updating vendors + adding doctrine bridge, and forms %!s(int64=12) %!d(string=hai) anos
EventDispatcherInterface.php 32682a9ca8 Updating vendor %!s(int64=12) %!d(string=hai) anos
EventSubscriberInterface.php 32682a9ca8 Updating vendor %!s(int64=12) %!d(string=hai) anos
GenericEvent.php 8b76813307 Adding web profiler provider %!s(int64=12) %!d(string=hai) anos
ImmutableEventDispatcher.php 32682a9ca8 Updating vendor %!s(int64=12) %!d(string=hai) anos
LICENSE 32682a9ca8 Updating vendor %!s(int64=12) %!d(string=hai) anos
README.md 7464887946 Updating vendors %!s(int64=11) %!d(string=hai) anos
composer.json 224a0e666e Updating vendors %!s(int64=11) %!d(string=hai) anos
phpunit.xml.dist 8b76813307 Adding web profiler provider %!s(int64=12) %!d(string=hai) anos

README.md

EventDispatcher Component

EventDispatcher implements a lightweight version of the Observer design pattern.

use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\Event;

$dispatcher = new EventDispatcher();

$dispatcher->addListener('event_name', function (Event $event) {
    // ...
});

$dispatcher->dispatch('event_name');

Resources

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/EventDispatcher/
$ composer.phar install
$ phpunit