Skip to content

Commit

Permalink
add method getListenerPriority() to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Oct 20, 2015
1 parent 99de3fd commit f8019c8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 2 additions & 0 deletions UPGRADE-3.0.md
Expand Up @@ -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`.

Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/EventDispatcher/CHANGELOG.md
Expand Up @@ -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.
Expand Down
9 changes: 1 addition & 8 deletions src/Symfony/Component/EventDispatcher/EventDispatcher.php
Expand Up @@ -73,14 +73,7 @@ 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 to remove
*
* @return int|null The event listener priority
* {@inheritdoc}
*/
public function getListenerPriority($eventName, $listener)
{
Expand Down
12 changes: 12 additions & 0 deletions src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php
Expand Up @@ -77,6 +77,18 @@ public function removeSubscriber(EventSubscriberInterface $subscriber);
*/
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.
*
Expand Down

0 comments on commit f8019c8

Please sign in to comment.