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.

Metric   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 53
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A measurements() 0 3 1
A create() 0 3 1
A __toString() 0 3 1
A config() 0 3 1
A __construct() 0 6 1
A fromString() 0 5 1
A time() 0 3 1
A tags() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace ReactInspector;
4
5
use function explode;
6
use function microtime;
7
8
final class Metric
9
{
10
    private Config $config;
11
12
    private float $time;
13
14
    private Tags $tags;
15
16
    private Measurements $measurements;
17
18
    public function __construct(Config $config, Tags $tags, Measurements $measurements, float $time)
19
    {
20
        $this->config       = $config;
21
        $this->tags         = $tags;
22
        $this->measurements = $measurements;
23
        $this->time         = $time;
24
    }
25
26
    public static function create(Config $config, Tags $tags, Measurements $measurements): self
27
    {
28
        return new self($config, $tags, $measurements, microtime(true));
29
    }
30
31
    public function __toString(): string
32
    {
33
        return $this->config . '%' . $this->tags . '%' . $this->measurements . '%' . $this->time;
34
    }
35
36
    public static function fromString(string $string): Metric
37
    {
38
        [$config, $tags, $measurements, $time] = explode('%', $string);
39
40
        return new Metric(Config::fromString($config), Tags::fromString($tags), Measurements::fromString($measurements), (float) $time);
41
    }
42
43
    public function config(): Config
44
    {
45
        return $this->config;
46
    }
47
48
    public function time(): float
49
    {
50
        return $this->time;
51
    }
52
53
    public function tags(): Tags
54
    {
55
        return $this->tags;
56
    }
57
58
    public function measurements(): Measurements
59
    {
60
        return $this->measurements;
61
    }
62
}
63