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

Commit ed5fb45

Browse files
committed
feat: ListenerProvider namespace and interface
Creates a forwards-compatibility shim for the `ListenerProviderInterface`, in a new subnamespace, `Zend\EventManager\ListenerProviderInterface`.
1 parent 8b89424 commit ed5fb45

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

TODO-PSR-14.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
- [x] Modify `EventManager` internals to use the PSR-14 method if available
1111
- [x] Mark `StoppableEventInterface` as deprecated
1212
- [ ] Listener provider implementation
13-
- [ ] Create a `ListenerProvider` subnamespace
14-
- [ ] Create a `ListenerProviderInterface` shim
13+
- [x] Create a `ListenerProvider` subnamespace
14+
- [x] Create a `ListenerProviderInterface` shim
1515
- [ ] Create a `PrioritizedListenerProvider` interface extending the
1616
`ListenerProviderInterface` and defining a
1717
`getListenersForEventByPriority($event, array $identifiers = []) : array<int, callable[]>` method.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* @see https://github.com/zendframework/zend-eventmanager for the canonical source repository
4+
* @copyright Copyright (c) 2019 Zend Technologies USA Inc. (https://www.zend.com)
5+
* @license https://github.com/zendframework/zend-eventmanager/blob/master/LICENSE.md New BSD License
6+
*/
7+
8+
namespace Zend\EventManager\ListenerProvider;
9+
10+
/**
11+
* @deprecated This interface is a forwards-compatibility shim for use until we can
12+
* provide full PSR-14 compatibility, and will be removed in version 4.0.
13+
*/
14+
interface ListenerProviderInterface
15+
{
16+
/**
17+
* @param object $event The event for which to retrieve listeners.
18+
* @return callable[] Iterable list of listeners to which to pass the event.
19+
*/
20+
public function getListenersForEvent($event);
21+
}

0 commit comments

Comments
 (0)