Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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