Clinner\Command\Command::parse PHP Method

parse() protected static method

If no valid command is found, a NullCommand will be returned.
protected static parse ( string $commandString, array $options = [] ) : Clinner\Command\CommandInterface
$commandString string The command string to parse.
$options array (Optional) options for the command.
return Clinner\Command\CommandInterface
    protected static function parse($commandString, $options = array())
    {
        $members = array_filter(explode(' ', $commandString));
        if (!empty($members)) {
            $commandName = array_shift($members);
            return new Command($commandName, $members, $options);
        }
        return new NullCommand();
    }