public function commandFor(array $argv): Command
    {
        $argv += [null, null, null];

        return
             // cmd
            $this->commands[$argv[1]]
            // cmd alias
            ?? $this->commands[$this->aliases[$argv[1]] ?? null]
            // default.
            ?? $this->commands[$this->default];
    }
public function commandFor(array $argv): Command
    {
        $argv += [null, null, null];

        return
             // cmd
            $this->commands[$argv[1]]
            // cmd alias
            ?? $this->commands[$this->aliases[$argv[1]] ?? null]
            // default.
            ?? $this->commands[$this->default];
    }
public function commandFor ( array $ argv ) : Command { $ argv += [ null , null , null ] ; return // cmd $ this -> commands [ $ argv [ 1 ] ] // cmd alias ?? $ this -> commands [ $ this -> aliases [ $ argv [ 1 ] ] ?? null ] // default. ?? $ this -> commands [ $ this -> default ] ; }
Gets matching command for given argv.

@param array $argv

@return Command
Gets matching command for given argv .