caipin b0d376d83b 更新代码 9 vuotta sitten
..
Debug b0d376d83b 更新代码 9 vuotta sitten
Tests b0d376d83b 更新代码 9 vuotta sitten
.gitignore b0d376d83b 更新代码 9 vuotta sitten
CHANGELOG.md b0d376d83b 更新代码 9 vuotta sitten
ContainerAwareEventDispatcher.php b0d376d83b 更新代码 9 vuotta sitten
Event.php b0d376d83b 更新代码 9 vuotta sitten
EventDispatcher.php b0d376d83b 更新代码 9 vuotta sitten
EventDispatcherInterface.php b0d376d83b 更新代码 9 vuotta sitten
EventSubscriberInterface.php b0d376d83b 更新代码 9 vuotta sitten
GenericEvent.php b0d376d83b 更新代码 9 vuotta sitten
ImmutableEventDispatcher.php b0d376d83b 更新代码 9 vuotta sitten
LICENSE b0d376d83b 更新代码 9 vuotta sitten
README.md b0d376d83b 更新代码 9 vuotta sitten
composer.json b0d376d83b 更新代码 9 vuotta sitten
phpunit.xml.dist b0d376d83b 更新代码 9 vuotta sitten

README.md

EventDispatcher Component

The Symfony2 EventDispatcher component implements the Mediator pattern in a simple and effective way to make your projects truly extensible.

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