public function getAllListeners() : array
    {
        foreach ($this->listeners as $event => $listeners) {
            if (! isset($this->sorted[$event])) {
                $this->sorted[$event] = $this->sortListeners($listeners);
            }
        }

        return $this->sorted;
    }