src/Viserio/Component/Events/EventManager.php
public function getListenerPriority(string $eventName, $listener): ?int
    {
        if (! isset($this->listeners[$eventName]) && \count($this->listeners[$eventName]) === 0) {
            return null;
        }

        if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof Closure) {
            $listener[0] = $listener[0]();
        }

        foreach ($this->listeners[$eventName] as $priority => $listeners) {
            foreach ($listeners as $key => $value) {
                if ($value !== $listener && \is_array($value) && isset($value[0]) && $value[0] instanceof Closure) {
                    $value[0]                                     = $value[0]();
                    $this->listeners[$eventName][$priority][$key] = $value;
                }

                if ($listener === $value) {
                    return $priority;
                }
            }
        }

        return null;
    }
public function getListenerPriority(string $eventName, $listener): ?int
    {
        if (! isset($this->listeners[$eventName]) && \count($this->listeners[$eventName]) === 0) {
            return null;
        }

        if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof Closure) {
            $listener[0] = $listener[0]();
        }

        foreach ($this->listeners[$eventName] as $priority => $listeners) {
            foreach ($listeners as $key => $value) {
                if ($value !== $listener && \is_array($value) && isset($value[0]) && $value[0] instanceof Closure) {
                    $value[0]                                     = $value[0]();
                    $this->listeners[$eventName][$priority][$key] = $value;
                }

                if ($listener === $value) {
                    return $priority;
                }
            }
        }

        return 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 array|callable $listener  The listener

@return null|int The event listener priority

@internal