protected function pushToQueue($event, $key, $priority)
    {
        $end = substr($event, -2);
        if (isset($this->queues[$event])) {
            if ($end == self::WILDCARD) {
                $this->wildcardSearching = true;
                $this->queues[$event][] = ['key' => $key, 'priority' => $priority];
            } else {
                $this->queues[$event]->insert($key, $priority);
            }
        } else {
            if ($end == self::WILDCARD) {
                $this->wildcardSearching = true;
                $this->queues[$event][] = ['key' => $key, 'priority' => $priority];
            } else {
                $this->queues[$event] = new PriorityQueue;
                $this->queues[$event]->insert($key, $priority);
            }
        }
    }
protected function pushToQueue($event, $key, $priority)
    {
        $end = substr($event, -2);
        if (isset($this->queues[$event])) {
            if ($end == self::WILDCARD) {
                $this->wildcardSearching = true;
                $this->queues[$event][] = ['key' => $key, 'priority' => $priority];
            } else {
                $this->queues[$event]->insert($key, $priority);
            }
        } else {
            if ($end == self::WILDCARD) {
                $this->wildcardSearching = true;
                $this->queues[$event][] = ['key' => $key, 'priority' => $priority];
            } else {
                $this->queues[$event] = new PriorityQueue;
                $this->queues[$event]->insert($key, $priority);
            }
        }
    }
protected function pushToQueue ( $ event , $ key , $ priority ) { $ end = substr ( $ event , - 2 ) ; if ( isset ( $ this -> queues [ $ event ] ) ) { if ( $ end == self :: WILDCARD ) { $ this -> wildcardSearching = true ; $ this -> queues [ $ event ] [ ] = [ 'key' => $ key , 'priority' => $ priority ] ; } else { $ this -> queues [ $ event ] -> insert ( $ key , $ priority ) ; } } else { if ( $ end == self :: WILDCARD ) { $ this -> wildcardSearching = true ; $ this -> queues [ $ event ] [ ] = [ 'key' => $ key , 'priority' => $ priority ] ; } else { $ this -> queues [ $ event ] = new PriorityQueue ; $ this -> queues [ $ event ] -> insert ( $ key , $ priority ) ; } } }
Store a callback's key and priority in a queue indexed
by the event they are attached to.

@param $event The name of the event this callback is being attached to
@param string $key The key the callback is stored under
@priority The priority this callback has within this queue
Store a callback s key and priority in a queue indexed by the event they are attached to .