private static function parseArgument(string $token): InputArgument
    {
        [$token, $description] = static::extractDescription($token);

        switch (true) {
            case self::endsWith($token, '=*]'):
                return new InputArgument(\trim($token, '[=*]'), InputArgument::IS_ARRAY, $description);
            case self::endsWith($token, '=*'):
                return new InputArgument(\trim($token, '=*'), InputArgument::IS_ARRAY | InputArgument::REQUIRED, $description);
            case \preg_match('/(.*)\?$/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::OPTIONAL, $description);
            case \preg_match('/\[(.+)\?\]/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::OPTIONAL, $description);
            case \preg_match('/\[(.+)\=\*(.+)\]/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::IS_ARRAY, $description, \preg_split('/,\s?/', $matches[2]));
            case \preg_match('/\[(.+)\=(.+)\]/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::OPTIONAL, $description, $matches[2]);
            case self::startsWith($token, '[') && self::endsWith($token, ']'):
                return new InputArgument(\trim($token, '[]'), InputArgument::OPTIONAL, $description);

            default:
                return new InputArgument($token, InputArgument::REQUIRED, $description);
        }
    }
private static function parseArgument(string $token): InputArgument
    {
        [$token, $description] = static::extractDescription($token);

        switch (true) {
            case self::endsWith($token, '=*]'):
                return new InputArgument(\trim($token, '[=*]'), InputArgument::IS_ARRAY, $description);
            case self::endsWith($token, '=*'):
                return new InputArgument(\trim($token, '=*'), InputArgument::IS_ARRAY | InputArgument::REQUIRED, $description);
            case \preg_match('/(.*)\?$/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::OPTIONAL, $description);
            case \preg_match('/\[(.+)\?\]/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::OPTIONAL, $description);
            case \preg_match('/\[(.+)\=\*(.+)\]/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::IS_ARRAY, $description, \preg_split('/,\s?/', $matches[2]));
            case \preg_match('/\[(.+)\=(.+)\]/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::OPTIONAL, $description, $matches[2]);
            case self::startsWith($token, '[') && self::endsWith($token, ']'):
                return new InputArgument(\trim($token, '[]'), InputArgument::OPTIONAL, $description);

            default:
                return new InputArgument($token, InputArgument::REQUIRED, $description);
        }
    }
private static function parseArgument ( string $ token ) : InputArgument { [ $ token , $ description ] = static :: extractDescription ( $ token ) ; switch ( true ) { case self :: endsWith ( $ token , '=*]' ) : return new InputArgument ( \ trim ( $ token , '[=*]' ) , InputArgument :: IS_ARRAY , $ description ) ; case self :: endsWith ( $ token , '=*' ) : return new InputArgument ( \ trim ( $ token , '=*' ) , InputArgument :: IS_ARRAY | InputArgument :: REQUIRED , $ description ) ; case \ preg_match ( '/(.*)\?$/' , $ token , $ matches ) : return new InputArgument ( $ matches [ 1 ] , InputArgument :: OPTIONAL , $ description ) ; case \ preg_match ( '/\[(.+)\?\]/' , $ token , $ matches ) : return new InputArgument ( $ matches [ 1 ] , InputArgument :: OPTIONAL , $ description ) ; case \ preg_match ( '/\[(.+)\=\*(.+)\]/' , $ token , $ matches ) : return new InputArgument ( $ matches [ 1 ] , InputArgument :: IS_ARRAY , $ description , \ preg_split ( '/,\s?/' , $ matches [ 2 ] ) ) ; case \ preg_match ( '/\[(.+)\=(.+)\]/' , $ token , $ matches ) : return new InputArgument ( $ matches [ 1 ] , InputArgument :: OPTIONAL , $ description , $ matches [ 2 ] ) ; case self :: startsWith ( $ token , '[' ) && self :: endsWith ( $ token , ']' ) : return new InputArgument ( \ trim ( $ token , '[]' ) , InputArgument :: OPTIONAL , $ description ) ; default : return new InputArgument ( $ token , InputArgument :: REQUIRED , $ description ) ; } }
Parse arguments.

@param string $token

@throws \Symfony\Component\Console\Exception\InvalidArgumentException

@return \Viserio\Component\Console\Input\InputArgument
Parse arguments .