No Description

sunhao fe08a6fbcc 初始 5 years ago
..
Debug fe08a6fbcc 初始 5 years ago
DependencyInjection fe08a6fbcc 初始 5 years ago
Tests fe08a6fbcc 初始 5 years ago
.gitignore fe08a6fbcc 初始 5 years ago
CHANGELOG.md fe08a6fbcc 初始 5 years ago
ContainerAwareEventDispatcher.php fe08a6fbcc 初始 5 years ago
Event.php fe08a6fbcc 初始 5 years ago
EventDispatcher.php fe08a6fbcc 初始 5 years ago
EventDispatcherInterface.php fe08a6fbcc 初始 5 years ago
EventSubscriberInterface.php fe08a6fbcc 初始 5 years ago
GenericEvent.php fe08a6fbcc 初始 5 years ago
ImmutableEventDispatcher.php fe08a6fbcc 初始 5 years ago
LICENSE fe08a6fbcc 初始 5 years ago
README.md fe08a6fbcc 初始 5 years ago
composer.json fe08a6fbcc 初始 5 years ago
phpunit.xml.dist fe08a6fbcc 初始 5 years ago

README.md

EventDispatcher Component

The Symfony 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