1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-30 12:52:24 -05:00
wallabag/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher
2013-08-03 19:26:54 +02:00
..
Debug twig implementation 2013-08-03 19:26:54 +02:00
Tests twig implementation 2013-08-03 19:26:54 +02:00
.gitignore twig implementation 2013-08-03 19:26:54 +02:00
CHANGELOG.md twig implementation 2013-08-03 19:26:54 +02:00
composer.json twig implementation 2013-08-03 19:26:54 +02:00
ContainerAwareEventDispatcher.php twig implementation 2013-08-03 19:26:54 +02:00
Event.php twig implementation 2013-08-03 19:26:54 +02:00
EventDispatcher.php twig implementation 2013-08-03 19:26:54 +02:00
EventDispatcherInterface.php twig implementation 2013-08-03 19:26:54 +02:00
EventSubscriberInterface.php twig implementation 2013-08-03 19:26:54 +02:00
GenericEvent.php twig implementation 2013-08-03 19:26:54 +02:00
ImmutableEventDispatcher.php twig implementation 2013-08-03 19:26:54 +02:00
LICENSE twig implementation 2013-08-03 19:26:54 +02:00
phpunit.xml.dist twig implementation 2013-08-03 19:26:54 +02:00
README.md twig implementation 2013-08-03 19:26:54 +02:00

EventDispatcher Component

EventDispatcher implements a lightweight version of the Observer design pattern.

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 --dev
$ phpunit