63c77aae53
Conflicts: composer.json src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php src/Symfony/Component/ClassLoader/DebugClassLoader.php src/Symfony/Component/ClassLoader/UniversalClassLoader.php src/Symfony/Component/Console/Input/StringInput.php src/Symfony/Component/Debug/DebugClassLoader.php src/Symfony/Component/DependencyInjection/Container.php src/Symfony/Component/DependencyInjection/ContainerBuilder.php src/Symfony/Component/DependencyInjection/ContainerInterface.php src/Symfony/Component/DependencyInjection/Definition.php src/Symfony/Component/DependencyInjection/DefinitionDecorator.php src/Symfony/Component/DependencyInjection/Scope.php src/Symfony/Component/DependencyInjection/ScopeInterface.php src/Symfony/Component/DomCrawler/composer.json src/Symfony/Component/EventDispatcher/Event.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/HttpKernel/KernelInterface.php src/Symfony/Component/HttpKernel/Log/LoggerInterface.php src/Symfony/Component/HttpKernel/Log/NullLogger.php src/Symfony/Component/Security/Core/composer.json src/Symfony/Component/Security/Resources/translations/security.tr.xlf src/Symfony/Component/Security/composer.json src/Symfony/Component/Translation/Translator.php |
||
---|---|---|
.. | ||
Debug | ||
DependencyInjection | ||
Tests | ||
.gitignore | ||
CHANGELOG.md | ||
composer.json | ||
ContainerAwareEventDispatcher.php | ||
Event.php | ||
EventDispatcher.php | ||
EventDispatcherInterface.php | ||
EventSubscriberInterface.php | ||
GenericEvent.php | ||
ImmutableEventDispatcher.php | ||
LICENSE | ||
phpunit.xml.dist | ||
README.md |
EventDispatcher Component
The Symfony EventDispatcher component implements the Mediator pattern in a simple and effective way to make your projects truly extensible.
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 install
$ phpunit