Pantheon\Terminus\Commands\Remote\SSHBaseCommand::validateCommand PHP Method

validateCommand() protected method

Validates the command as available
protected validateCommand ( array $command ) : boolean
$command array
return boolean
    protected function validateCommand(array $command)
    {
        $is_valid = true;
        foreach ($command as $element) {
            if (isset($this->unavailable_commands[$element])) {
                $is_valid = false;
                $message = "That command is not available via Terminus. ";
                $message .= "Please use the native {command} command.";
                $interpolations = ['command' => $this->command];
                if (!empty($alternative = $this->unavailable_commands[$element])) {
                    $message .= " Hint: You may want to try `{suggestion}`.";
                    $interpolations['suggestion'] = "terminus {$alternative}";
                }
                $this->log()->error($message, $interpolations);
            }
        }
        return $is_valid;
    }