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::causedBy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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