src/AbstractEngine.php
protected function storeCommand(CommandInterface $command)
    {
        $priority = $command->getPriority();
        
        for ($count = count($this->commands), $i = 0; $i < $count; $i++) {
            if ($this->commands[$i]->getPriority() < $priority) {
                array_splice($this->commands, $i, 0, [
                    $command
                ]);
                
                return $command;
            }
        }
        
        return $this->commands[] = $command;
    }
protected function storeCommand(CommandInterface $command)
    {
        $priority = $command->getPriority();
        
        for ($count = count($this->commands), $i = 0; $i < $count; $i++) {
            if ($this->commands[$i]->getPriority() < $priority) {
                array_splice($this->commands, $i, 0, [
                    $command
                ]);
                
                return $command;
            }
        }
        
        return $this->commands[] = $command;
    }
Queues a command according to it's priority.

@param CommandInterface $command
@return CommandInterface