This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier 7fe18d13a0 merged branch mtdowling/event_dispatcher_add_iterator (PR #5268)
Commits
-------

0ad00f8 [EventDispatcher] Adding IteratorAggregate to GenericEvent

Discussion
----------

[EventDispatcher] Adding IteratorAggregate to GenericEvent

---------------------------------------------------------------------------

by drak at 2012-08-16T07:43:29Z

What is the use case for this that it should be part of the Generic event?

---------------------------------------------------------------------------

by mtdowling at 2012-08-16T17:12:28Z

This allows for the GenericEvent to be even more generic. Now listeners don't need to know an exact key from the arguments, but rather can iterate over the arguments to find what they are looking for. This makes the GenericEvent more like an array.

---------------------------------------------------------------------------

by mtdowling at 2012-08-17T19:31:04Z

How would this be a nasty break? It's just giving the GenericEvent more capabilities with IteratorAggregate.

This is a completely separate PR from the one that flipped the constructor args.

---------------------------------------------------------------------------

by schmittjoh at 2012-08-17T19:34:47Z

Why are you not just doing ``foreach ($event->getArguments() as $arg) { /** ... */ }``?

If you just have ``foreach ($event)``, to me at least it would not be so clear what we are actually iterating over.

---------------------------------------------------------------------------

by mtdowling at 2012-08-17T19:39:23Z

This class already has ArrayAccess. If you're already using this class like an array, then I think you should expect to be able to iterate it like an array. I'm just finishing that concept off by implementing IteratorAggregate.

---------------------------------------------------------------------------

by schmittjoh at 2012-08-17T19:47:43Z

Indeed, if we already have ArrayAccess which we probably don't want to remove again, then that seems reasonable.
2012-08-18 10:28:12 +02:00
src/Symfony merged branch mtdowling/event_dispatcher_add_iterator (PR #5268) 2012-08-18 10:28:12 +02:00
.editorconfig Add EditorConfig File 2012-06-16 14:08:15 +02:00
.gitignore ignore composer.phar 2012-04-20 14:10:06 +01:00
.travis.yml [Locale] don't create a "current" directory anymore, uses only the ICU version as the name of the data directory 2012-08-07 12:17:02 -03:00
autoload.php.dist removed unneeded code 2012-06-30 16:47:41 +02:00
CHANGELOG-2.0.md merged 2.0 2012-08-03 11:11:11 +02:00
composer.json [Composer] Bumped doctrine/orm to 2.2.3 2012-07-31 16:51:24 +02:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.0.14 2012-05-17 18:30:22 +02:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
phpunit.xml.dist Set init.default_locale to 'en' in phpunit.xml.dist 2012-05-11 09:33:42 +02:00
README.md added some warnings about known PHP bugs 2012-07-15 12:19:52 +02:00
UPGRADE-2.1.md fixed typos in the UPGRADE file 2012-08-16 20:10:26 +02:00

README

Build Status

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.3 and up.

Be warned that PHP versions before 5.3.8 are known to be buggy and might not work for you:

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.