src/Parser/VariableParser.php
private function parseVariableParameter($variable, $default, $exists, $empty, $type)
    {
        if ($exists && !$empty) {
            return $this->getVariable($variable);
        }

        return $this->assignVariableParameterDefault($variable, $default, $empty, $type);
    }
private function parseVariableParameter($variable, $default, $exists, $empty, $type)
    {
        if ($exists && !$empty) {
            return $this->getVariable($variable);
        }

        return $this->assignVariableParameterDefault($variable, $default, $empty, $type);
    }
Parses and sets the variable and default if needed

@param string $variable The variable to parse
@param string $default  The default value
@param bool   $exists   Does the variable exist
@param bool   $empty    Is there the variable empty if exists and the empty flag is set
@param string $type     The type of parameter expansion

@return string The parsed value