Env   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Composer\Config;
6
7
final class Env
8
{
9
    public static function get(string $key, $default = null): callable
10
    {
11
        if (count(func_get_args()) === 2) {
12
            return static fn () => $_ENV[$key] ?? $default;
13
        }
14
15
        return static fn () => $_ENV[$key];
16
    }
17
}
18