zendframework/zf2 — pull request #5399 by bakura10 (2013-11-01 09:33:33+00:00)
Title: [ZF3] Clean event manager

Hi everyone,

This is a preliminary work for a clean-up EVM for ZF3. Event manager was pretty well done so this is mostly cleanup, optimizations, merging some interfaces, removing deprecated code.

I'd like your feedback on some choices I've made.

* The StaticEventManager was removed as it was deprecated just after ZF2 release in favour of SharedEventManager.
* A lot of PHPDoc fixing, and some code were updated to respect interface contract.
* Methods have been reordered to group more logically methods.
* Use callable type hint where possible.
* propagationIsStopped has been renamed to isPropagationStopped (and all the code that rely on it has been updated).
* trigger and triggerUntil are complicated methods. They accept a lot of parameters and the behavior changes depending on the order parameters are passed. To add to the complexity, trigger accepted a last parameter to emulate triggerUntil. To simplify the signature, no callback can be added to trigger now. You should use triggerUntil to that. It makes the code more explicit and makes the implementation simpler.
* For the same idea, the "attach" method no longer accepts a ListenerAggregate. You must use the attachAggregate method for that. This allow to avoid to test instance of against ListenerAggregate whenever we attach something. We can now also type hint for callable in the attach method which avoids another test.

All tests have been updated.

TODO:

[ ] Backport the "Filter" feature.
[ ] Feedback ?