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   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 3
dl 0
loc 34
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A channel() 0 8 2
A closed() 0 4 2
A close() 0 9 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