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