input/formats/parsers/Argv.php
public function parse(interfaces\Tokens $input, values\Arguments $arguments, values\Options $options) : void
    {
        $isParsingOptions = true;

        // Grab all tokens. Can't iterate directly over the Collection as we need to easily determine
        // which tokens are left to be processed (thus array_shift() below).
        $input = $input->all();

        // Loop through the input given.
        while (null !== $token = array_shift($input)) {

            if ($isParsingOptions) {
                // When '--' is present as a token, it forces us to treat
                // everything following it as arguments.
                if ('--' === $token) {
                    $isParsingOptions = false;
                    continue;
                }

                // Full options (token beginning with two hyphens).
                if (0 === strpos($token, '--')) {
                    $this->parseLongOption($token, $options, $input);
                    continue;
                }

                // Shortcuts (token beginning with exactly one hyphen).
                if ('-' === $token[0]) {
                    $this->parseShortOption($token, $options, $input);
                    continue;
                }
            }

            // In any other case treat the token as an argument.
            $arguments->push($token);
        }
    }
public function parse(interfaces\Tokens $input, values\Arguments $arguments, values\Options $options) : void
    {
        $isParsingOptions = true;

        // Grab all tokens. Can't iterate directly over the Collection as we need to easily determine
        // which tokens are left to be processed (thus array_shift() below).
        $input = $input->all();

        // Loop through the input given.
        while (null !== $token = array_shift($input)) {

            if ($isParsingOptions) {
                // When '--' is present as a token, it forces us to treat
                // everything following it as arguments.
                if ('--' === $token) {
                    $isParsingOptions = false;
                    continue;
                }

                // Full options (token beginning with two hyphens).
                if (0 === strpos($token, '--')) {
                    $this->parseLongOption($token, $options, $input);
                    continue;
                }

                // Shortcuts (token beginning with exactly one hyphen).
                if ('-' === $token[0]) {
                    $this->parseShortOption($token, $options, $input);
                    continue;
                }
            }

            // In any other case treat the token as an argument.
            $arguments->push($token);
        }
    }
public function parse ( interfaces \ Tokens $ input , values \ Arguments $ arguments , values \ Options $ options ) : void { $ isParsingOptions = true ; // Grab all tokens. Can't iterate directly over the Collection as we need to easily determine // which tokens are left to be processed (thus array_shift() below). $ input = $ input -> all ( ) ; // Loop through the input given. while ( null !== $ token = array_shift ( $ input ) ) { if ( $ isParsingOptions ) { // When '--' is present as a token, it forces us to treat // everything following it as arguments. if ( '--' === $ token ) { $ isParsingOptions = false ; continue ; } // Full options (token beginning with two hyphens). if ( 0 === strpos ( $ token , '--' ) ) { $ this -> parseLongOption ( $ token , $ options , $ input ) ; continue ; } // Shortcuts (token beginning with exactly one hyphen). if ( '-' === $ token [ 0 ] ) { $ this -> parseShortOption ( $ token , $ options , $ input ) ; continue ; } } // In any other case treat the token as an argument. $ arguments -> push ( $ token ) ; } }
Fill the given Input Arguments and Options based on their definitions and the Argv input given.

@param   values\Arguments    $arguments  The Input Arguments to fill.
@param   values\Options      $options    The Input Options to fill.
@param   tokens\Argv         $input      The Argv tokens to be parsed.
Fill the given Input Arguments and Options based on their definitions and the Argv input given .