Skip to content

Commit 923803f

Browse files
committed
Add getListenersPriority(eventName, listener) to EventDispatcherAbstract
This function is required by the interface of event-dispatcher version 3. Moreover this commit fixes a test which was added in event-dispatcher 2.8.
1 parent ac44f03 commit 923803f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Adapters/EventDispatcherAdapter.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,19 @@ public function hasListeners($eventName = null)
137137
return ($this->symfonyDispatcher->hasListeners($eventName) ||
138138
$this->laravelDispatcher->hasListeners($eventName));
139139
}
140+
141+
/**
142+
* Gets the listener priority for a specific event.
143+
*
144+
* Returns null if the event or the listener does not exist.
145+
*
146+
* @param string $eventName The name of the event
147+
* @param callable $listener The listener
148+
*
149+
* @return int|null The event listener priority
150+
*/
151+
public function getListenerPriority($eventName, $listener)
152+
{
153+
return $this->symfonyDispatcher->getListenerPriority($eventName, $listener);
154+
}
140155
}

0 commit comments

Comments
 (0)