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.

Exchange   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 41
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A delete() 0 14 2
A declare() 0 14 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Client\Channel\Exchange;
5
6
use Innmind\AMQP\{
7
    Client\Channel\Exchange as ExchangeInterface,
8
    Model\Exchange\Declaration,
9
    Model\Exchange\Deletion,
10
    Transport\Connection,
11
    Transport\Frame\Channel,
12
};
13
14
final class Exchange implements ExchangeInterface
15
{
16
    private $connection;
17
    private $channel;
18
19 14
    public function __construct(Connection $connection, Channel $channel)
20
    {
21 14
        $this->connection = $connection;
22 14
        $this->channel = $channel;
23 14
    }
24
25 2
    public function declare(Declaration $command): ExchangeInterface
26
    {
27 2
        $this->connection->send(
28 2
            $this->connection->protocol()->exchange()->declare(
29 2
                $this->channel,
30 1
                $command
31
            )
32
        );
33
34 2
        if ($command->shouldWait()) {
35 2
            $this->connection->wait('exchange.declare-ok');
36
        }
37
38 2
        return $this;
39
    }
40
41 2
    public function delete(Deletion $command): ExchangeInterface
42
    {
43 2
        $this->connection->send(
44 2
            $this->connection->protocol()->exchange()->delete(
45 2
                $this->channel,
46 1
                $command
47
            )
48
        );
49
50 2
        if ($command->shouldWait()) {
51 2
            $this->connection->wait('exchange.delete-ok');
52
        }
53
54 2
        return $this;
55
    }
56
}
57