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

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

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