kekrozsak/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher
Polonkai Gergely b82b4ffd34 Made document editing possible 2012-07-22 19:38:00 +02:00
..
Debug Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
Tests Made document editing possible 2012-07-22 19:38:00 +02:00
.gitignore Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
CHANGELOG.md Made document editing possible 2012-07-22 19:38:00 +02:00
ContainerAwareEventDispatcher.php Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
Event.php Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
EventDispatcher.php Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
EventDispatcherInterface.php Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
EventSubscriberInterface.php Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
GenericEvent.php Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
ImmutableEventDispatcher.php Made document editing possible 2012-07-22 19:38:00 +02:00
LICENSE Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
README.md Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
composer.json Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
phpunit.xml.dist Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00

README.md

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:

phpunit

If you also want to run the unit tests that depend on other Symfony Components, install dev dependencies before running PHPUnit:

php composer.phar install --dev