Julio Montoya 7464887946 Updating vendors 11 jaren geleden
..
Debug 32682a9ca8 Updating vendor 12 jaren geleden
Tests 3d9752111b Updating vendor 11 jaren geleden
CHANGELOG.md 32682a9ca8 Updating vendor 12 jaren geleden
ContainerAwareEventDispatcher.php 8b76813307 Adding web profiler provider 12 jaren geleden
Event.php 8b76813307 Adding web profiler provider 12 jaren geleden
EventDispatcher.php 1ad9119c46 Updating vendors + adding doctrine bridge, and forms 12 jaren geleden
EventDispatcherInterface.php 32682a9ca8 Updating vendor 12 jaren geleden
EventSubscriberInterface.php 32682a9ca8 Updating vendor 12 jaren geleden
GenericEvent.php 8b76813307 Adding web profiler provider 12 jaren geleden
ImmutableEventDispatcher.php 32682a9ca8 Updating vendor 12 jaren geleden
LICENSE 32682a9ca8 Updating vendor 12 jaren geleden
README.md 7464887946 Updating vendors 11 jaren geleden
composer.json 224a0e666e Updating vendors 11 jaren geleden
phpunit.xml.dist 8b76813307 Adding web profiler provider 12 jaren geleden

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