vairogs/vairogs

View on GitHub
src/Vairogs/Component/Functions/Local/_GetEnv.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php declare(strict_types = 1);

namespace Vairogs\Component\Functions\Local;

use function getenv;

trait _GetEnv
{
    public function getenv(
        string $name,
        bool $localOnly = true,
    ): mixed {
        return getenv(name: $name, local_only: $localOnly) ?: ($_ENV[$name] ?? $name);
    }
}