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

Commit 30e2255

Browse files
committed
feat: adds a ListenerSubscriberInterface
Added to the ListenerProvider namespace. Accepts a PrioritizedListenerAttachmentInterface argument, to which it will subscribe listeners.
1 parent cee0ba5 commit 30e2255

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

TODO-PSR-14.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
`getListenersForEventByPriority()` method of each, returning the
4747
aggregated listeners in priority order.
4848
- [x] Make `SharedEventManager` an extension of `PrioritizedIdentifierListenerProvider`
49-
- [ ] Create `ListenerSubscriberInterface`
50-
- [ ] `attach(PrioritizedListenerAttachmentInterface $provider, $priority = 1)`
51-
- [ ] `detach(PrioritizedListenerAttachmentInterface $provider)`
49+
- [x] Create `ListenerSubscriberInterface`
50+
- [x] `attach(PrioritizedListenerAttachmentInterface $provider, $priority = 1)`
51+
- [x] `detach(PrioritizedListenerAttachmentInterface $provider)`
5252
- [ ] Create `AbstractListenerSubscriber` and/or `ListenerSubscriberTrait`
5353
- [ ] define a default `detach()` implementation
5454
- [ ] Create `LazyListenerSubscriber` based on `LazyListenerAggregate`
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 ListenerSubscriberInterface
11+
{
12+
/**
13+
* @param int $priority Default priority at which to attach composed listeners.
14+
* @return void
15+
*/
16+
public function attach(PrioritizedListenerAttachmentInterface $provider, $priority = 1);
17+
18+
/**
19+
* @return void
20+
*/
21+
public function detach(PrioritizedListenerAttachmentInterface $provider);
22+
}

0 commit comments

Comments
 (0)