caipin b0d376d83b 更新代码 8 年之前
..
Debug b0d376d83b 更新代码 8 年之前
Tests b0d376d83b 更新代码 8 年之前
.gitignore b0d376d83b 更新代码 8 年之前
CHANGELOG.md b0d376d83b 更新代码 8 年之前
ContainerAwareEventDispatcher.php b0d376d83b 更新代码 8 年之前
Event.php b0d376d83b 更新代码 8 年之前
EventDispatcher.php b0d376d83b 更新代码 8 年之前
EventDispatcherInterface.php b0d376d83b 更新代码 8 年之前
EventSubscriberInterface.php b0d376d83b 更新代码 8 年之前
GenericEvent.php b0d376d83b 更新代码 8 年之前
ImmutableEventDispatcher.php b0d376d83b 更新代码 8 年之前
LICENSE b0d376d83b 更新代码 8 年之前
README.md b0d376d83b 更新代码 8 年之前
composer.json b0d376d83b 更新代码 8 年之前
phpunit.xml.dist b0d376d83b 更新代码 8 年之前

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