src/Parser/VariableParser.php
public function parse($value, $quoted_string = false)
    {
        $matches = $this->fetchVariableMatches($value);

        if (is_array($matches)) {
            if ($this->parser->string_helper->isVariableClone($value, $matches, $quoted_string)) {
                return $this->fetchVariable($value, $matches[1][0], $matches, $quoted_string);
            }

            $value = $this->doReplacements($value, $matches, $quoted_string);
        }

        return $value;
    }
public function parse($value, $quoted_string = false)
    {
        $matches = $this->fetchVariableMatches($value);

        if (is_array($matches)) {
            if ($this->parser->string_helper->isVariableClone($value, $matches, $quoted_string)) {
                return $this->fetchVariable($value, $matches[1][0], $matches, $quoted_string);
            }

            $value = $this->doReplacements($value, $matches, $quoted_string);
        }

        return $value;
    }
Parses a .env variable

@param string $value         The value to parse
@param bool   $quoted_string Is the value in a quoted string

@return string The parsed value