Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 1e8c205

Browse files
committed
feat: deprecate features that will be removed in version 4
- `EventInterface` - `EventManagerInterface` - `EventManagerAwareInterface` - `EventManagerAwareTrait` - `EventsCapableInterface` (points people to `EventDispatchingInterface`) - `SharedEventManager` - `SharedEventManagerInterface` - `SharedEventsCapableInterface` - `ListenerAggregateInterface` (points people to the `PrioritizedListenerAttachmentInterface`) - `ListenerAggregateTrait` (points people to `ListenerSubscriberTrait`) - `AbstractListenerAggregate` (points people to `AbstractListenerSubscriber` and/or `ListenerSubscriberTrait`) - `ResponseCollection` (tells people to aggregate state/results in the event itself) - `LazyListener` (points people to `ListenerProvider\LazyListener`) - `LazyEventListener` (points people to `ListenerProvider\LazyListener`) - `LazyListenerAggregate` (points people to `ListenerProvider\LazyListenerSubscriber`) - `FilterChain` and `Filter` subnamespace (this should be done in a separate component)
1 parent 67c522b commit 1e8c205

18 files changed

+70
-17
lines changed

TODO-PSR-14.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@
9191
- [x] Additional utilities
9292
- [x] `EventDispatchingInterface` with a `getEventDispatcher()` method
9393
- [ ] Deprecations
94-
- [ ] `EventInterface`
95-
- [ ] `EventManagerInterface`
96-
- [ ] `EventManagerAwareInterface`
97-
- [ ] `EventManagerAwareTrait`
98-
- [ ] `EventsCapableInterface` (point people to `EventDispatchingInterface`)
99-
- [ ] `SharedEventManager`
100-
- [ ] `SharedEventManagerInterface`
101-
- [ ] `SharedEventsCapableInterface`
102-
- [ ] `ListenerAggregateInterface` (point people to the `PrioritizedListenerAttachmentInterface`)
103-
- [ ] `ListenerAggregateTrait` (point people to `ListenerSubscriberTrait`)
104-
- [ ] `AbstractListenerAggregate` (point people to `AbstractListenerSubscriber` and/or `ListenerSubscriberTrait`)
105-
- [ ] `ResponseCollection` (tell people to aggregate state/results in the event itself)
106-
- [ ] `LazyListener` (point people to `ListenerProvider\LazyListener`)
107-
- [ ] `LazyEventListener` (point people to `ListenerProvider\LazyListener`)
108-
- [ ] `LazyListenerAggregate` (point people to `ListenerProvider\LazyListenerSubscriber`)
109-
- [ ] `FilterChain` and `Filter` subnamespace (this should be done in a separate component)
94+
- [x] `EventInterface`
95+
- [x] `EventManagerInterface`
96+
- [x] `EventManagerAwareInterface`
97+
- [x] `EventManagerAwareTrait`
98+
- [x] `EventsCapableInterface` (point people to `EventDispatchingInterface`)
99+
- [x] `SharedEventManager`
100+
- [x] `SharedEventManagerInterface`
101+
- [x] `SharedEventsCapableInterface`
102+
- [x] `ListenerAggregateInterface` (point people to the `PrioritizedListenerAttachmentInterface`)
103+
- [x] `ListenerAggregateTrait` (point people to `ListenerSubscriberTrait`)
104+
- [x] `AbstractListenerAggregate` (point people to `AbstractListenerSubscriber` and/or `ListenerSubscriberTrait`)
105+
- [x] `ResponseCollection` (tell people to aggregate state/results in the event itself)
106+
- [x] `LazyListener` (point people to `ListenerProvider\LazyListener`)
107+
- [x] `LazyEventListener` (point people to `ListenerProvider\LazyListener`)
108+
- [x] `LazyListenerAggregate` (point people to `ListenerProvider\LazyListenerSubscriber`)
109+
- [x] `FilterChain` and `Filter` subnamespace (this should be done in a separate component)
110110

111111
## 4.0.0 full release
112112

src/AbstractListenerAggregate.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
/**
1313
* Abstract aggregate listener
14+
*
15+
* @deprecated since 3.3.0. This class will be removed in version 4.0.0, in
16+
* favor of the ListenerProvider\AbstractListenerSubscriber. In most cases,
17+
* subscribers should fully implement ListenerSubscriberInterface on their
18+
* own, however.
1419
*/
1520
abstract class AbstractListenerAggregate implements ListenerAggregateInterface
1621
{

src/EventInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
/**
1515
* Representation of an event
16+
*
17+
* @deprecated since 3.3.0. This interface will be removed in version 4.0, in
18+
* favor of using simple PHP objects as events.
1619
*/
1720
interface EventInterface
1821
{

src/EventManagerAwareInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
/**
1313
* Interface to automate setter injection for an EventManager instance
14+
*
15+
* @deprecated since 3.3.0. This interface will be removed in version 4.0.
1416
*/
1517
interface EventManagerAwareInterface extends EventsCapableInterface
1618
{

src/EventManagerAwareTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* EventManager into your object when it is pulled from the ServiceManager.
2121
*
2222
* @see Zend\Mvc\Service\ServiceManagerConfig
23+
* @deprecated since 3.3.0. This trait will be removed in version 4.0.
2324
*/
2425
trait EventManagerAwareTrait
2526
{

src/EventManagerInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
/**
1313
* Interface for messengers
14+
*
15+
* @deprecated since 3.3.0; this interface will be removed in version 4.0, in
16+
* favor of the PSR-14 EventDispatcherInterface and ListenerProviderInterface.
1417
*/
1518
interface EventManagerInterface extends SharedEventsCapableInterface
1619
{

src/EventsCapableInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
/**
1313
* Interface indicating that an object composes an EventManagerInterface instance.
14+
*
15+
* @deprecated since 3.3.0. This interface will be removed in version 4.0, in
16+
* favor of the EventDispatcherInterface introduced in version 3.3.0.
1417
*/
1518
interface EventsCapableInterface
1619
{

src/Filter/FilterInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
/**
1515
* Interface for intercepting filter chains
16+
*
17+
* @deprecated since 3.3.0. This interface will be removed in version 4.0.0. No
18+
* replacement is provided.
1619
*/
1720
interface FilterInterface
1821
{

src/Filter/FilterIterator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
* Specialized priority queue implementation for use with an intercepting
1717
* filter chain.
1818
*
19-
* Allows removal
19+
* Allows removal.
20+
*
21+
* @deprecated since 3.3.0. This class will be removed in version 4.0.0. No
22+
* replacement is provided.
2023
*/
2124
class FilterIterator extends FastPriorityQueue
2225
{

src/FilterChain.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
/**
1313
* FilterChain: intercepting filter manager
14+
*
15+
* @deprecated since 3.3.0. This class will be removed in version 4.0.0. No
16+
* replacement is provided.
1417
*/
1518
class FilterChain implements Filter\FilterInterface
1619
{

src/LazyEventListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
*
2323
* - event: the event name to attach to.
2424
* - priority: the priority at which to attach the listener, if not the default.
25+
*
26+
* @deprecated since 3.3.0. This class will be removed in version 4.0.0, in
27+
* favor of the ListenerProvider\LazyListener implementation.
2528
*/
2629
class LazyEventListener extends LazyListener
2730
{

src/LazyListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
*
2929
* Pass instances directly to the event manager's `attach()` method as the
3030
* listener argument.
31+
*
32+
* @deprecated since 3.3.0. This class will be removed in version 4.0.0, in
33+
* favor of the ListenerProvider\LazyListener implementation.
3134
*/
3235
class LazyListener
3336
{

src/LazyListenerAggregate.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
* $container
2727
* ));
2828
* </code>
29+
*
30+
* @deprecated since 3.3.0. This class will be removed in version 4.0.0 in
31+
* favor of the ListenerProvider\LazyListenerSubscriber implementation.
2932
*/
3033
class LazyListenerAggregate implements ListenerAggregateInterface
3134
{

src/ListenerAggregateInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* with an EventManager, without an event name. The {@link attach()} method will
1717
* then be called with the current EventManager instance, allowing the class to
1818
* wire up one or more listeners.
19+
*
20+
* @deprecated since 3.3.0. This interface will be removed in version 4.0.0, in
21+
* favor of the ListenerProvider\ListenerSubscriberInterface.
1922
*/
2023
interface ListenerAggregateInterface
2124
{

src/ListenerAggregateTrait.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
/**
1313
* Provides logic to easily create aggregate listeners, without worrying about
1414
* manually detaching events
15+
*
16+
* @deprecated since 3.3.0. This trait will be removed in version 4.0.0, in
17+
* favor of the ListenerProvider\ListenerSubscriberTrait. In most cases,
18+
* subscribers should fully implement ListenerSubscriberInterface on their
19+
* own, however.
1520
*/
1621
trait ListenerAggregateTrait
1722
{

src/ResponseCollection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313

1414
/**
1515
* Collection of signal handler return values
16+
*
17+
* @deprecated since 3.3.0. This class will be removed in version 4.0.0.
18+
* Listeners should not return values, and any values that should be
19+
* aggregated or used to stop propagation should be injected directly into
20+
* the event instance itself, via its own published API.
1621
*/
1722
class ResponseCollection extends SplStack
1823
{

src/SharedEventManagerInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
/**
1313
* Interface for shared event listener collections
14+
*
15+
* @deprecated since 3.3.0. This interface will be removed in version 4.0; use
16+
* listener providers instead.
1417
*/
1518
interface SharedEventManagerInterface
1619
{

src/SharedEventsCapableInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
/**
1313
* Interface indicating that an object composes or can compose a
1414
* SharedEventManagerInterface instance.
15+
*
16+
* @deprecated since 3.3.0. This interface will be removed in version 4.0.
1517
*/
1618
interface SharedEventsCapableInterface
1719
{

0 commit comments

Comments
 (0)