Daniel ab1334c0cf the whole shebang 9 years ago
..
Debug ab1334c0cf the whole shebang 9 years ago
Tests ab1334c0cf the whole shebang 9 years ago
.gitignore ab1334c0cf the whole shebang 9 years ago
CHANGELOG.md ab1334c0cf the whole shebang 9 years ago
ContainerAwareEventDispatcher.php ab1334c0cf the whole shebang 9 years ago
Event.php ab1334c0cf the whole shebang 9 years ago
EventDispatcher.php ab1334c0cf the whole shebang 9 years ago
EventDispatcherInterface.php ab1334c0cf the whole shebang 9 years ago
EventSubscriberInterface.php ab1334c0cf the whole shebang 9 years ago
GenericEvent.php ab1334c0cf the whole shebang 9 years ago
ImmutableEventDispatcher.php ab1334c0cf the whole shebang 9 years ago
LICENSE ab1334c0cf the whole shebang 9 years ago
README.md ab1334c0cf the whole shebang 9 years ago
composer.json ab1334c0cf the whole shebang 9 years ago
phpunit.xml.dist ab1334c0cf the whole shebang 9 years ago

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:

$ cd path/to/Symfony/Component/EventDispatcher/
$ composer.phar install --dev
$ phpunit