1 EventDispatcher Component
2 =========================
4 EventDispatcher implements a lightweight version of the Observer design
7 use Symfony\Component\EventDispatcher\EventDispatcher;
8 use Symfony\Component\EventDispatcher\Event;
10 $dispatcher = new EventDispatcher();
12 $dispatcher->addListener('event_name', function (Event $event) {
16 $dispatcher->dispatch('event_name');
21 You can run the unit tests with the following command:
23 $ cd path/to/Symfony/Component/EventDispatcher/
24 $ composer.phar install --dev