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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 80%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 22
c 1
b 0
f 1
ccs 8
cts 10
cp 0.8
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A make() 0 12 3
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