src/Application/ConsoleApplication.php
/**
     * Parses the --set command line parameter value.
     *
     * @param string                $value        The --set command line parameter value.
     * @param ParseContextInterface $parseContext The parse context.
     */
Parses the --set command line parameter value.
@param string                $value        The --set command line parameter value.
@param ParseContextInterface $parseContext The parse context.
Parses the -- set command line parameter value . @param string $value The -- set command line parameter value . @param ParseContextInterface $parseContext The parse context .
private function parseSetCommandLineParameter(string $value, ParseContextInterface $parseContext, ?string &$error): bool
    {
        $variableParts = explode('=', $value, 2);
        $variableName = trim($variableParts[0]);
        if ($variableName === '') {
            $error = 'Missing variable name.';
            return false;
        }
        if (!Parser::isValidVariableName($variableName)) {
            $error = 'Invalid variable name "' . $variableName . '".';
            return false;
        }
        $variableValue = count($variableParts) > 1 ? trim($variableParts[1]) : null;
        if ($variableValue === null) {
            $error = 'Missing variable value.';
            return false;
        }
        $parseContext->setVariable($variableName, $variableValue);
        return true;
    }
private function parseSetCommandLineParameter ( string $ value , ParseContextInterface $ parseContext , ? string & $ error ) : bool { $ variableParts = explode ( '=' , $ value , 2 ) ; $ variableName = trim ( $ variableParts [ 0 ] ) ; if ( $ variableName === '' ) { $ error = 'Missing variable name.' ; return false ; } if ( ! Parser :: isValidVariableName ( $ variableName ) ) { $ error = 'Invalid variable name "' . $ variableName . '".' ; return false ; } $ variableValue = count ( $ variableParts ) > 1 ? trim ( $ variableParts [ 1 ] ) : null ; if ( $ variableValue === null ) { $ error = 'Missing variable value.' ; return false ; } $ parseContext -> setVariable ( $ variableName , $ variableValue ) ; return true ; }
Parses the --set command line parameter value.
Parses the -- set command line parameter value .