From f8019c80b4bab8dccd198a0bb7c954dfb5153cc3 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 20 Oct 2015 19:32:54 +0200 Subject: [PATCH] add method getListenerPriority() to interface --- UPGRADE-3.0.md | 2 ++ src/Symfony/Component/EventDispatcher/CHANGELOG.md | 2 ++ .../Component/EventDispatcher/EventDispatcher.php | 9 +-------- .../EventDispatcher/EventDispatcherInterface.php | 12 ++++++++++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index d7b617f46b..a47839e44d 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -107,6 +107,8 @@ UPGRADE FROM 2.x to 3.0 ### EventDispatcher + * The method `getListenerPriority($eventName, $listener)` has been added to the + `EventDispatcherInterface`. * The interface `Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface` extends `Symfony\Component\EventDispatcher\EventDispatcherInterface`. diff --git a/src/Symfony/Component/EventDispatcher/CHANGELOG.md b/src/Symfony/Component/EventDispatcher/CHANGELOG.md index 359b28f3f2..8feda35d57 100644 --- a/src/Symfony/Component/EventDispatcher/CHANGELOG.md +++ b/src/Symfony/Component/EventDispatcher/CHANGELOG.md @@ -4,6 +4,8 @@ CHANGELOG 3.0.0 ----- + * The method `getListenerPriority($eventName, $listener)` has been added to the + `EventDispatcherInterface`. * The methods `Event::setDispatcher()`, `Event::getDispatcher()`, `Event::setName()` and `Event::getName()` have been removed. The event dispatcher and the event name are passed to the listener call. diff --git a/src/Symfony/Component/EventDispatcher/EventDispatcher.php b/src/Symfony/Component/EventDispatcher/EventDispatcher.php index 2a033700ff..e1882d2323 100644 --- a/src/Symfony/Component/EventDispatcher/EventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/EventDispatcher.php @@ -73,14 +73,7 @@ class EventDispatcher implements EventDispatcherInterface } /** - * Gets the listener priority for a specific event. - * - * Returns null if the event or the listener does not exist. - * - * @param string $eventName The name of the event - * @param callable $listener The listener to remove - * - * @return int|null The event listener priority + * {@inheritdoc} */ public function getListenerPriority($eventName, $listener) { diff --git a/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php b/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php index a9bdd2c886..e0ba65f950 100644 --- a/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php +++ b/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php @@ -77,6 +77,18 @@ interface EventDispatcherInterface */ public function getListeners($eventName = null); + /** + * Gets the listener priority for a specific event. + * + * Returns null if the event or the listener does not exist. + * + * @param string $eventName The name of the event + * @param callable $listener The listener + * + * @return int|null The event listener priority + */ + public function getListenerPriority($eventName, $listener); + /** * Checks whether an event has any registered listeners. *