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   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 32
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 3 1
A fromString() 0 5 1
A value() 0 3 1
A tags() 0 3 1
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