-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
This patch provides a forwards-compatibility release that adapts zend-eventmanager to work as a PSR-14 EventDispatcher. It does so by doing the following:
- Creating package-specific
ListenerProviderInterface
andEventDispatcherInterface
versions that work with PHP 5.6. - Moving all listener aggregation into classes within a
ListenerProvider
subnamespace; this includes both the listener attachment previously in theEventManager
instance as well as theSharedEventManager
instance. - Renaming "listener aggregates" to "listener subscribers" in the new
ListenerProvider
subnamespace. - Adapting
EventManager
to consume listener providers. By default, it will create a default priority-based listener provider, and have its various listener attachment methods proxy to that provider; it then aggregates that provider with the SharedEventManager (which is itself a provider now) in order to retrieve listeners. This is done in such a way that behavior is completely backwards compatible with current usage.- A new named constructor,
createUsingListenerProvider()
, allows providing a specific listener provider for use with theEventManager
. If the provider is attachment capable, the various listener attachment methods will proxy to it; otherwise, they will raise an exception.
- A new named constructor,
The patch also deprecates a number of features, including:
- Most interfaces, including the
EventInterface
. - The entire "shared event manager" concept (this can be accomplished via event object hierarchies instead)
TODO
- Write changelog entries
- Create documentation of new features
- Document how to start migrating to the new features in order to prepare for version 4
Originally posted by @weierophinney at zendframework/zend-eventmanager#73