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.

Type   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 27
dl 0
loc 62
ccs 23
cts 23
cp 1
rs 10
c 0
b 0
f 0
wmc 11

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A body() 0 3 1
A toInt() 0 3 1
A method() 0 3 1
A heartbeat() 0 3 1
A header() 0 3 1
A fromInt() 0 17 5
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Transport\Frame;
5
6
use Innmind\AMQP\Exception\UnknownFrameType;
7
8
final class Type
9
{
10
    private const METHOD = 1;
11
    private const HEADER = 2;
12
    private const BODY = 3;
13
    private const HEARTBEAT = 8;
14
15
    private static $method;
16
    private static $header;
17
    private static $body;
18
    private static $heartbeat;
19
20
    private $value;
21
22 4
    private function __construct(int $value)
23
    {
24 4
        $this->value = $value;
25 4
    }
26
27 186
    public static function method(): self
28
    {
29 186
        return self::$method ?? self::$method = new self(self::METHOD);
30
    }
31
32 62
    public static function header(): self
33
    {
34 62
        return self::$header ?? self::$header = new self(self::HEADER);
35
    }
36
37 54
    public static function body(): self
38
    {
39 54
        return self::$body ?? self::$body = new self(self::BODY);
40
    }
41
42 108
    public static function heartbeat(): self
43
    {
44 108
        return self::$heartbeat ?? self::$heartbeat = new self(self::HEARTBEAT);
45
    }
46
47 114
    public static function fromInt(int $value): self
48
    {
49
        switch ($value) {
50 114
            case self::METHOD:
51 98
                return self::method();
52
53 50
            case self::HEADER:
54 36
                return self::header();
55
56 46
            case self::BODY:
57 36
                return self::body();
58
59 10
            case self::HEARTBEAT:
60 4
                return self::heartbeat();
61
62
            default:
63 6
                throw new UnknownFrameType((string) $value);
64
        }
65
    }
66
67 200
    public function toInt(): int
68
    {
69 200
        return $this->value;
70
    }
71
}
72