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

Memory   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 7
c 1
b 0
f 0
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 3
A toFloat() 0 3 1
A toString() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Server\Status\Server\Process;
5
6
use Innmind\Server\Status\Exception\OutOfBoundsPercentage;
7
8
final class Memory
9
{
10
    private float $value;
11
12 21
    public function __construct(float $value)
13
    {
14 21
        if ($value < 0 || $value > 100) {
15 6
            throw new OutOfBoundsPercentage((string) $value);
16
        }
17
18 15
        $this->value = $value;
19 15
    }
20
21 3
    public function toFloat(): float
22
    {
23 3
        return $this->value;
24
    }
25
26 3
    public function toString(): string
27
    {
28 3
        return $this->value.'%';
29
    }
30
}
31