Daniel ab1334c0cf the whole shebang 10 年之前
..
Debug ab1334c0cf the whole shebang 10 年之前
Tests ab1334c0cf the whole shebang 10 年之前
.gitignore ab1334c0cf the whole shebang 10 年之前
CHANGELOG.md ab1334c0cf the whole shebang 10 年之前
ContainerAwareEventDispatcher.php ab1334c0cf the whole shebang 10 年之前
Event.php ab1334c0cf the whole shebang 10 年之前
EventDispatcher.php ab1334c0cf the whole shebang 10 年之前
EventDispatcherInterface.php ab1334c0cf the whole shebang 10 年之前
EventSubscriberInterface.php ab1334c0cf the whole shebang 10 年之前
GenericEvent.php ab1334c0cf the whole shebang 10 年之前
ImmutableEventDispatcher.php ab1334c0cf the whole shebang 10 年之前
LICENSE ab1334c0cf the whole shebang 10 年之前
README.md ab1334c0cf the whole shebang 10 年之前
composer.json ab1334c0cf the whole shebang 10 年之前
phpunit.xml.dist ab1334c0cf the whole shebang 10 年之前

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