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.

Fluent   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 32
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0
wmc 7

4 Methods

Rating   Name   Duplication   Size   Complexity  
A closed() 0 3 2
A __construct() 0 3 1
A close() 0 8 2
A channel() 0 7 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 4
    public function __construct(ClientInterface $client)
14
    {
15 4
        $this->client = $client;
16 4
    }
17
18 2
    public function channel(): Channel
19
    {
20 2
        if ($this->closed()) {
21 2
            return new Channel\NullChannel;
22
        }
23
24 2
        return new Channel\Fluent($this->client->channel());
25
    }
26
27 2
    public function closed(): bool
28
    {
29 2
        return $this->closed || $this->client->closed();
30
    }
31
32 2
    public function close(): void
33
    {
34 2
        if ($this->closed()) {
35 2
            return;
36
        }
37
38 2
        $this->client->close();
39 2
        $this->closed = true;
40 2
    }
41
}
42