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.
Completed
Push — develop ( e4addc...44f5b4 )
by Baptiste
23:22
created

Fluent::channel()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Client;
5
6
use Innmind\AMQP\Client as ClientInterface;
7
8
final class Fluent implements ClientInterface
9
{
10
    private $client;
11
    private $closed = false;
12
13 1
    public function __construct(ClientInterface $client)
14
    {
15 1
        $this->client = $client;
16 1
    }
17
18 1
    public function channel(): Channel
19
    {
20 1
        if ($this->closed()) {
21 1
            return new Channel\NullChannel;
22
        }
23
24 1
        return new Channel\Fluent($this->client->channel());
25
    }
26
27 1
    public function closed(): bool
28
    {
29 1
        return $this->closed || $this->client->closed();
30
    }
31
32 1
    public function close(): void
33
    {
34 1
        if ($this->closed()) {
35 1
            return;
36
        }
37
38 1
        $this->client->close();
39 1
        $this->closed = true;
40 1
    }
41
}
42