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 — develop ( 9ca8cc...2705d1 )
by Baptiste
03:06
created

ServerFactory::make()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3.2098

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 12
c 1
b 0
f 1
ccs 5
cts 7
cp 0.7143
rs 9.4285
cc 3
eloc 7
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\TimeContinuumInterface;
12
13
final class ServerFactory
14
{
15
    private $clock;
16
17 1
    public function __construct(TimeContinuumInterface $clock)
18
    {
19 1
        $this->clock = $clock;
20 1
    }
21
22 1
    public function make(): Server
23
    {
24 1
        switch (PHP_OS) {
25 1
            case 'Darwin':
26
                return new OSX($this->clock);
27
28 1
            case 'Linux':
29 1
                return new Linux($this->clock);
30
        }
31
32
        throw new UnsupportedOperatingSystem;
33
    }
34
}
35