JiraRestApi\Configuration\DotEnvConfiguration::env PHP Метод

env() приватный Метод

Gets the value of an environment variable. Supports boolean, empty and null.
private env ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
Результат mixed
    private function env($key, $default = null)
    {
        $value = getenv($key);
        if ($value === false) {
            return $default;
        }
        switch (strtolower($value)) {
            case 'true':
            case '(true)':
                return true;
            case 'false':
            case '(false)':
                return false;
            case 'empty':
            case '(empty)':
                return '';
            case 'null':
            case '(null)':
                return;
        }
        if ($this->startsWith($value, '"') && endsWith($value, '"')) {
            return substr($value, 1, -1);
        }
        return $value;
    }