src/Parser/VariableParser.php
private function fetchVariable($value, $variable_name, $matches, $quoted_string)
    {
        if ($this->hasParameterExpansion($variable_name)) {
            $replacement = $this->fetchParameterExpansion($variable_name);
        } elseif ($this->hasVariable($variable_name)) {
            $replacement = $this->getVariable($variable_name);
        } else {
            throw new ParseException(
                sprintf('Variable has not been defined: %s', $variable_name),
                $value,
                $this->parser->line_num
            );
        }

        if ($this->parser->string_helper->isBoolInString($replacement, $quoted_string, count($matches[0]))) {
            $replacement = ($replacement) ? 'true' : 'false';
        }

        return $replacement;
    }
private function fetchVariable($value, $variable_name, $matches, $quoted_string)
    {
        if ($this->hasParameterExpansion($variable_name)) {
            $replacement = $this->fetchParameterExpansion($variable_name);
        } elseif ($this->hasVariable($variable_name)) {
            $replacement = $this->getVariable($variable_name);
        } else {
            throw new ParseException(
                sprintf('Variable has not been defined: %s', $variable_name),
                $value,
                $this->parser->line_num
            );
        }

        if ($this->parser->string_helper->isBoolInString($replacement, $quoted_string, count($matches[0]))) {
            $replacement = ($replacement) ? 'true' : 'false';
        }

        return $replacement;
    }
Parses a .env variable

@param string $value The value to parse
@param string $variable_name The variable name to get
@param array $matches The matches of the variables
@param bool $quoted_string Is the value in a quoted string

@return string The parsed value
@throws \M1\Env\Exception\ParseException If the variable can not be found