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.

Measurement::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
namespace ReactInspector;
4
5
use function explode;
6
7
final class Measurement
8
{
9
    private float $value;
10
11
    private Tags $tags;
12
13
    public function __construct(float $value, Tags $tags)
14
    {
15
        $this->value = $value;
16
        $this->tags  = $tags;
17
    }
18
19
    public function __toString(): string
20
    {
21
        return $this->value . '#' . $this->tags();
22
    }
23
24
    public static function fromString(string $string): Measurement
25
    {
26
        [$value, $tags] = explode('#', $string);
27
28
        return new Measurement((float) $value, Tags::fromString($tags));
29
    }
30
31
    public function value(): float
32
    {
33
        return $this->value;
34
    }
35
36
    public function tags(): Tags
37
    {
38
        return $this->tags;
39
    }
40
}
41