05815adb22
* 2.5: added missing use statements added missing use statement added missing use statement fixed CS [Process] fixed some volatile tests [HttpKernel] fixed a volatile test [HttpFoundation] fixed some volatile tests [Tests] PHPUnit Optimizations Use getPathname() instead of string casting to get BinaryFileReponse file path Conflicts: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php src/Symfony/Component/Process/Process.php src/Symfony/Component/Stopwatch/Stopwatch.php src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php src/Symfony/Component/Yaml/Parser.php src/Symfony/Component/Yaml/Tests/InlineTest.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 Symfony2 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.phar install
$ phpunit