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

Commit 092b8e3

Browse files
committed
feat: Creates PrioritizedListenerProviderInterface
For use in getting a lookup table of priorities and associated listeners, optionally using identifiers for lookup.
1 parent ed5fb45 commit 092b8e3

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

TODO-PSR-14.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- [ ] Listener provider implementation
1313
- [x] Create a `ListenerProvider` subnamespace
1414
- [x] Create a `ListenerProviderInterface` shim
15-
- [ ] Create a `PrioritizedListenerProvider` interface extending the
15+
- [x] Create a `PrioritizedListenerProvider` interface extending the
1616
`ListenerProviderInterface` and defining a
1717
`getListenersForEventByPriority($event, array $identifiers = []) : array<int, callable[]>` method.
1818
- [ ] Create a `PrioritizedListenerAttachmentInterface`, defining:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
interface PrioritizedListenerProviderInterface extends ListenerProviderInterface
11+
{
12+
/**
13+
* @param object $event The event for which to retrieve listeners.
14+
* @param string[] $identifiers For use with shared listener providers.
15+
* This argument is deprecated, and will be removed in version 4.0.
16+
* @return array<int, callable[]> Returns a hash table of priorities with
17+
* the associated listeners for that priority.
18+
*/
19+
public function getListenersForEventByPriority($event, array $identifiers = []);
20+
}

0 commit comments

Comments
 (0)