8.5.x EventDispatcher.php EventDispatcher::getListenerPriority($eventName, $listener)
8.1.x EventDispatcher.php EventDispatcher::getListenerPriority($eventName, $listener)
8.2.x EventDispatcher.php EventDispatcher::getListenerPriority($eventName, $listener)
8.3.x EventDispatcher.php EventDispatcher::getListenerPriority($eventName, $listener)
8.4.x EventDispatcher.php EventDispatcher::getListenerPriority($eventName, $listener)
8.6.x EventDispatcher.php EventDispatcher::getListenerPriority($eventName, $listener)

Gets the listener priority for a specific event.

Returns null if the event or the listener does not exist.

Parameters

string $eventName The name of the event:

callable $listener The listener:

Return value

int|null The event listener priority

1 call to EventDispatcher::getListenerPriority()
ContainerAwareEventDispatcher::getListenerPriority in vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php
Gets the listener priority for a specific event.
1 method overrides EventDispatcher::getListenerPriority()
ContainerAwareEventDispatcher::getListenerPriority in vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php
Gets the listener priority for a specific event.

File

vendor/symfony/event-dispatcher/EventDispatcher.php, line 88

Class

EventDispatcher
The EventDispatcherInterface is the central point of Symfony's event listener system.

Namespace

Symfony\Component\EventDispatcher

Code

public function getListenerPriority($eventName, $listener) {
  if (!isset($this->listeners[$eventName])) {
    return;
  }
  foreach ($this->listeners[$eventName] as $priority => $listeners) {
    if (false !== in_array($listener, $listeners, true)) {
      return $priority;
    }
  }
}