protected function getValueOfCurrentCommandLineOption(string $currentArgument, array &$rawCommandLineArguments, string $expectedArgumentType)
    {
        if ((!isset($rawCommandLineArguments[0]) && (strpos($currentArgument, '=') === false)) || (isset($rawCommandLineArguments[0]) && $rawCommandLineArguments[0][0] === '-' && (strpos($currentArgument, '=') === false))) {
            return true;
        }

        if (strpos($currentArgument, '=') === false) {
            $possibleValue = trim(array_shift($rawCommandLineArguments));
            if (strpos($possibleValue, '=') === false) {
                if ($expectedArgumentType !== 'boolean') {
                    return $possibleValue;
                }
                if (array_search($possibleValue, ['on', '1', 'y', 'yes', 'true', 'TRUE']) !== false) {
                    return true;
                }
                if (array_search($possibleValue, ['off', '0', 'n', 'no', 'false', 'FALSE']) !== false) {
                    return false;
                }
                array_unshift($rawCommandLineArguments, $possibleValue);

                return true;
            }
            $currentArgument .= $possibleValue;
        }

        $splitArgument = explode('=', $currentArgument, 2);
        while ((!isset($splitArgument[1]) || trim($splitArgument[1]) === '') && count($rawCommandLineArguments) > 0) {
            $currentArgument .= array_shift($rawCommandLineArguments);
            $splitArgument = explode('=', $currentArgument);
        }

        return $splitArgument[1] ?? '';
    }
protected function getValueOfCurrentCommandLineOption(string $currentArgument, array &$rawCommandLineArguments, string $expectedArgumentType)
    {
        if ((!isset($rawCommandLineArguments[0]) && (strpos($currentArgument, '=') === false)) || (isset($rawCommandLineArguments[0]) && $rawCommandLineArguments[0][0] === '-' && (strpos($currentArgument, '=') === false))) {
            return true;
        }

        if (strpos($currentArgument, '=') === false) {
            $possibleValue = trim(array_shift($rawCommandLineArguments));
            if (strpos($possibleValue, '=') === false) {
                if ($expectedArgumentType !== 'boolean') {
                    return $possibleValue;
                }
                if (array_search($possibleValue, ['on', '1', 'y', 'yes', 'true', 'TRUE']) !== false) {
                    return true;
                }
                if (array_search($possibleValue, ['off', '0', 'n', 'no', 'false', 'FALSE']) !== false) {
                    return false;
                }
                array_unshift($rawCommandLineArguments, $possibleValue);

                return true;
            }
            $currentArgument .= $possibleValue;
        }

        $splitArgument = explode('=', $currentArgument, 2);
        while ((!isset($splitArgument[1]) || trim($splitArgument[1]) === '') && count($rawCommandLineArguments) > 0) {
            $currentArgument .= array_shift($rawCommandLineArguments);
            $splitArgument = explode('=', $currentArgument);
        }

        return $splitArgument[1] ?? '';
    }
protected function getValueOfCurrentCommandLineOption ( string $ currentArgument , array & $ rawCommandLineArguments , string $ expectedArgumentType ) { if ( ( ! isset ( $ rawCommandLineArguments [ 0 ] ) && ( strpos ( $ currentArgument , '=' ) === false ) ) || ( isset ( $ rawCommandLineArguments [ 0 ] ) && $ rawCommandLineArguments [ 0 ] [ 0 ] === '-' && ( strpos ( $ currentArgument , '=' ) === false ) ) ) { return true ; } if ( strpos ( $ currentArgument , '=' ) === false ) { $ possibleValue = trim ( array_shift ( $ rawCommandLineArguments ) ) ; if ( strpos ( $ possibleValue , '=' ) === false ) { if ( $ expectedArgumentType !== 'boolean' ) { return $ possibleValue ; } if ( array_search ( $ possibleValue , [ 'on' , '1' , 'y' , 'yes' , 'true' , 'TRUE' ] ) !== false ) { return true ; } if ( array_search ( $ possibleValue , [ 'off' , '0' , 'n' , 'no' , 'false' , 'FALSE' ] ) !== false ) { return false ; } array_unshift ( $ rawCommandLineArguments , $ possibleValue ) ; return true ; } $ currentArgument .= $ possibleValue ; } $ splitArgument = explode ( '=' , $ currentArgument , 2 ) ; while ( ( ! isset ( $ splitArgument [ 1 ] ) || trim ( $ splitArgument [ 1 ] ) === '' ) && count ( $ rawCommandLineArguments ) > 0 ) { $ currentArgument .= array_shift ( $ rawCommandLineArguments ) ; $ splitArgument = explode ( '=' , $ currentArgument ) ; } return $ splitArgument [ 1 ] ?? '' ; }
Returns the value of the first argument of the given input array. Shifts the parsed argument off the array.

@param string $currentArgument The current argument
@param array &$rawCommandLineArguments Array of the remaining command line arguments
@param string $expectedArgumentType The expected type of the current argument, because booleans get special attention
@return mixed The value of the first argument
Returns the value of the first argument of the given input array . Shifts the parsed argument off the array .