src/ParameterParser/ParameterParser.php
private function parseVariadicParameter(
        &$i,
        &$results,
        $closure,
        &$closure_arguments,
        $prefix,
        $parameter
    ) {
        $i++;
        while (
            isset($this->argv[$i]) &&
            ($argument = $this->argv[$i]) != null &&
            ! $this->prefixExists($argument)
        ) {
            $closure_arguments[] = $argument;
            $i++;
        }
        $parameterClosure = $this->getParameterClosure($parameter);
        if ($parameterClosure->parent != null) {
            if (count($closure_arguments) > 0) {
                $results[
                    $parameterClosure->parent->parameterName
                ] = $closure(...$closure_arguments);
            } else {
                $this->valid = false;
                if ($this->errorHandler != null) {
                    $this->errorHandler->call(
                        $this,
                        $parameterClosure,
                        'Missing argument for parameter closure.'
                    );
                }
            }
        } else {
            if (count($closure_arguments) > 0) {
                $results[
                    substr(
                        $parameter,
                        strlen($prefix),
                        strlen($parameter) - strlen($prefix)
                    )
                ] = $closure(...$closure_arguments);
            } else {
                $this->valid = false;
                if ($this->errorHandler != null) {
                    $this->errorHandler->call(
                        $this,
                        $parameterClosure,
                        'Missing argument for parameter closure.'
                    );
                }
            }
        }
    }
private function parseVariadicParameter(
        &$i,
        &$results,
        $closure,
        &$closure_arguments,
        $prefix,
        $parameter
    ) {
        $i++;
        while (
            isset($this->argv[$i]) &&
            ($argument = $this->argv[$i]) != null &&
            ! $this->prefixExists($argument)
        ) {
            $closure_arguments[] = $argument;
            $i++;
        }
        $parameterClosure = $this->getParameterClosure($parameter);
        if ($parameterClosure->parent != null) {
            if (count($closure_arguments) > 0) {
                $results[
                    $parameterClosure->parent->parameterName
                ] = $closure(...$closure_arguments);
            } else {
                $this->valid = false;
                if ($this->errorHandler != null) {
                    $this->errorHandler->call(
                        $this,
                        $parameterClosure,
                        'Missing argument for parameter closure.'
                    );
                }
            }
        } else {
            if (count($closure_arguments) > 0) {
                $results[
                    substr(
                        $parameter,
                        strlen($prefix),
                        strlen($parameter) - strlen($prefix)
                    )
                ] = $closure(...$closure_arguments);
            } else {
                $this->valid = false;
                if ($this->errorHandler != null) {
                    $this->errorHandler->call(
                        $this,
                        $parameterClosure,
                        'Missing argument for parameter closure.'
                    );
                }
            }
        }
    }
Parse a parameter belonging to a prefix that has a variadic
structure in it's closure definition and increment the
parameter parser.

@param  int                &$i
@param  array              &$results
@param  Closure            $closure
@param  array              &$closure_arguments
@param  string             $prefix
@param  string             $parameter