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

Cpu   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
eloc 18
c 1
b 0
f 1
dl 0
loc 46
ccs 20
cts 20
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A cores() 0 3 1
A idle() 0 3 1
A system() 0 3 1
A user() 0 3 1
A toString() 0 7 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Server\Status\Server;
5
6
use Innmind\Server\Status\Server\Cpu\{
7
    Percentage,
8
    Cores,
9
};
10
11
final class Cpu
12
{
13
    private Percentage $user;
14
    private Percentage $system;
15
    private Percentage $idle;
16
    private Cores $cores;
17
18 18
    public function __construct(
19
        Percentage $user,
20
        Percentage $system,
21
        Percentage $idle,
22
        Cores $cores
23
    ) {
24 18
        $this->user = $user;
25 18
        $this->system = $system;
26 18
        $this->idle = $idle;
27 18
        $this->cores = $cores;
28 18
    }
29
30 3
    public function user(): Percentage
31
    {
32 3
        return $this->user;
33
    }
34
35 3
    public function system(): Percentage
36
    {
37 3
        return $this->system;
38
    }
39
40 3
    public function idle(): Percentage
41
    {
42 3
        return $this->idle;
43
    }
44
45 3
    public function cores(): Cores
46
    {
47 3
        return $this->cores;
48
    }
49
50 3
    public function toString(): string
51
    {
52 3
        return \sprintf(
53 3
            'CPU usage: %s user, %s sys, %s idle',
54 3
            $this->user->toString(),
55 3
            $this->system->toString(),
56 3
            $this->idle->toString(),
57
        );
58
    }
59
}
60