Bachir Soussi Chiadmi 344dae1543 import from la bonne adresse and first refactoring for ouidade.com | 7 years ago | |
---|---|---|
.. | ||
Debug | 7 years ago | |
DependencyInjection | 7 years ago | |
Tests | 7 years ago | |
CHANGELOG.md | 7 years ago | |
ContainerAwareEventDispatcher.php | 7 years ago | |
Event.php | 7 years ago | |
EventDispatcher.php | 7 years ago | |
EventDispatcherInterface.php | 7 years ago | |
EventSubscriberInterface.php | 7 years ago | |
GenericEvent.php | 7 years ago | |
ImmutableEventDispatcher.php | 7 years ago | |
LICENSE | 7 years ago | |
README.md | 7 years ago | |
composer.json | 7 years ago | |
phpunit.xml.dist | 7 years ago |
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');
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/EventDispatcher/
$ composer install
$ phpunit