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.
Passed
Push — master ( 5892ba...e25f6a )
by Baptiste
03:37 queued 29s
created

ServerFactory::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Server\Status;
5
6
use Innmind\Server\Status\{
7
    Servers\OSX,
8
    Servers\Linux,
9
    Exception\UnsupportedOperatingSystem,
10
};
11
use Innmind\TimeContinuum\Clock;
12
13
final class ServerFactory
14
{
15
    private $clock;
16
17 3
    public function __construct(Clock $clock)
18
    {
19 3
        $this->clock = $clock;
20 3
    }
21
22 3
    public function __invoke(): Server
23
    {
24 3
        switch (\PHP_OS) {
25 3
            case 'Darwin':
26
                return new OSX($this->clock);
27
28 3
            case 'Linux':
29 3
                return new Linux($this->clock);
30
        }
31
32
        throw new UnsupportedOperatingSystem;
33
    }
34
35 3
    public static function build(Clock $clock): Server
36
    {
37 3
        return (new self($clock))();
38
    }
39
}
40