GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 01765c...2026ee )
by Matthew
11s
created

AggregateEnv::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Sphpeme\Env;
4
5
6
7
class AggregateEnv implements EnvInterface
8
{
9
    protected $extensions = [];
10
11
    public function __construct(EnvInterface ...$envs)
12
    {
13
        while ($env = array_pop($envs)) {
14
            $this->extensions[] = $env;
15
        }
16
    }
17
18
    public function __isset($prop): bool
19
    {
20
        foreach ($this->extensions as $extension) {
21
            if (isset($extension->$prop)) {
22
                return true;
23
            }
24
        }
25
        return false;
26
    }
27
28
    public function extend(EnvInterface $extension)
29
    {
30
        $new = clone $this;
31
        array_unshift($new->extensions, $extension);
32
        return $new;
33
    }
34
35
    public function __get(string $prop)
36
    {
37
        foreach ($this->extensions as $extension) {
38
            if (isset($extension->$prop)) {
39
                return $extension->__get($prop);
40
            }
41
        }
42
43
        return false;
44
    }
45
}