src/PubSub/Manager.php
private function sortSubscribers($eventName)
    {
        \krsort($this->subscribers[$eventName]);
        $this->sorted[$eventName] = array();
        foreach ($this->subscribers[$eventName] as $priority => $subscribers) {
            foreach ($subscribers as $k => $subscriber) {
                if ($this->isClosureFactory($subscriber)) {
                    $subscriber[0] = $subscriber[0]();
                    $this->subscribers[$eventName][$priority][$k] = $subscriber;
                }
                $this->sorted[$eventName][] = $subscriber;
            }
        }
    }
private function sortSubscribers($eventName)
    {
        \krsort($this->subscribers[$eventName]);
        $this->sorted[$eventName] = array();
        foreach ($this->subscribers[$eventName] as $priority => $subscribers) {
            foreach ($subscribers as $k => $subscriber) {
                if ($this->isClosureFactory($subscriber)) {
                    $subscriber[0] = $subscriber[0]();
                    $this->subscribers[$eventName][$priority][$k] = $subscriber;
                }
                $this->sorted[$eventName][] = $subscriber;
            }
        }
    }
Sorts the internal list of subscribers for the given event by priority.

@param string $eventName The name of the event

@return void