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.

Close   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 49
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A hasReply() 0 3 1
A replyCode() 0 3 1
A replyText() 0 3 1
A cause() 0 3 1
A causedKnown() 0 3 1
A causedBy() 0 6 1
A reply() 0 7 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Model\Channel;
5
6
final class Close
7
{
8
    private $replyCode;
9
    private $replyText;
10
    private $cause;
11
12 4
    public static function reply(int $code, string $text): self
13
    {
14 4
        $self = new self;
15 4
        $self->replyCode = $code;
16 4
        $self->replyText = $text;
17
18 4
        return $self;
19
    }
20
21
    /**
22
     * @param string $method ie: exchange.declare, channel.open, etc
23
     */
24 4
    public function causedBy(string $method): self
25
    {
26 4
        $self = clone $this;
27 4
        $self->cause = $method;
28
29 4
        return $self;
30
    }
31
32 80
    public function hasReply(): bool
33
    {
34 80
        return \is_int($this->replyCode);
35
    }
36
37 4
    public function replyCode(): int
38
    {
39 4
        return $this->replyCode;
40
    }
41
42 4
    public function replyText(): string
43
    {
44 4
        return $this->replyText;
45
    }
46
47 82
    public function causedKnown(): bool
48
    {
49 82
        return \is_string($this->cause);
50
    }
51
52 4
    public function cause(): string
53
    {
54 4
        return $this->cause;
55
    }
56
}
57