b126664406
* 2.1: (24 commits) forced Travis to use source to workaround their not-up-to-date Composer on PHP 5.3.3 [Routing] removed irrelevant string cast in Route Fixed typo Make YamlFileLoader and XmlFileLoader file loading extensible [HttpKernel] fix typo Fixed singularization of "prices" [Form] Removed an exception that prevented valid formats from being passed, e.g. "h" for the hour, "L" for the month etc. [HttpKernel] fixed Client when using StreamedResponses (closes #5370) fixed PDO session handler for Oracle (closes #5829) [HttpFoundation] fixed PDO session handler for Oracle (closes #5829) [Locale] removed a check that is done too early (and it is done twice anyways) Update src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf Adding new localized strings for farsi validation. [HttpFoundation] moved the HTTP protocol check from StreamedResponse to Response (closes #5937) [Form] Fixed forms not to be marked invalid if their children are already marked invalid [Form] Excluded some tests in NumberToLocalizedStringTransformerTest which fail on ICU 4.4, but work on ICU 4.8 added missing tests from previous merge [Form] Fixed NumberToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible Fix export-ignore on Windows Show correct class name InputArgument in error message ... Conflicts: .travis.yml src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php |
||
---|---|---|
.. | ||
Debug | ||
Tests | ||
.gitattributes | ||
.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
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