private function parseEnv(string $variableName, bool $required = true)
    {
        $result = null;

        if (\getenv($variableName) === 'false') {
            $result = false;
        } elseif (\getenv($variableName) === 'true') {
            $result = true;
        }
        if (\getenv($variableName) !== false) {
            $result = \getenv($variableName);
        }

        if ($required === true && $result === null) {
            throw new MissingEnvVariableException($variableName);
        }

        return $result;
    }
private function parseEnv(string $variableName, bool $required = true)
    {
        $result = null;

        if (\getenv($variableName) === 'false') {
            $result = false;
        } elseif (\getenv($variableName) === 'true') {
            $result = true;
        }
        if (\getenv($variableName) !== false) {
            $result = \getenv($variableName);
        }

        if ($required === true && $result === null) {
            throw new MissingEnvVariableException($variableName);
        }

        return $result;
    }
private function parseEnv ( string $ variableName , bool $ required = true ) { $ result = null ; if ( \ getenv ( $ variableName ) === 'false' ) { $ result = false ; } elseif ( \ getenv ( $ variableName ) === 'true' ) { $ result = true ; } if ( \ getenv ( $ variableName ) !== false ) { $ result = \ getenv ( $ variableName ) ; } if ( $ required === true && $ result === null ) { throw new MissingEnvVariableException ( $ variableName ) ; } return $ result ; }
Parse environmental variables to be either null if not required or throw an error if required.

@param string $variableName
@param bool   $required

@throws MissingEnvVariableException

@return null|string
Parse environmental variables to be either null if not required or throw an error if required .