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::make()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3.2098

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 11
ccs 5
cts 7
cp 0.7143
rs 10
cc 3
nc 3
nop 0
crap 3.2098
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