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 ( a0d7f6...1c3e27 )
by Baptiste
02:53
created

Channel::queue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Client\Channel;
5
6
use Innmind\AMQP\{
7
    Client\Channel as ChannelInterfce,
8
    Model\Channel\Close,
9
    Transport\Connection,
10
    Transport\Frame\Channel as Number
11
};
12
13
final class Channel implements ChannelInterfce
14
{
15
    private $connection;
16
    private $number;
17
    private $closed = false;
18
19 3
    public function __construct(Connection $connection, Number $number)
20
    {
21 3
        $this->connection = $connection;
22 3
        $this->number = $number;
23
24
        $connection
25 3
            ->send($connection->protocol()->channel()->open($number))
26 3
            ->wait('channel.open-ok');
27
28 3
        $this->exchange = new Exchange\Exchange($connection, $number);
0 ignored issues
show
Bug introduced by
The property exchange does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
29 3
        $this->queue = new Queue\Queue($connection, $number);
0 ignored issues
show
Bug introduced by
The property queue does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
30 3
        $this->basic = new Basic\Basic($connection, $number);
0 ignored issues
show
Bug introduced by
The property basic does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
31 3
        $this->transaction = new Transaction\Transaction($connection, $number);
0 ignored issues
show
Bug introduced by
The property transaction does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
32 3
    }
33
34 1
    public function exchange(): Exchange
35
    {
36 1
        return $this->exchange;
37
    }
38
39 1
    public function queue(): Queue
40
    {
41 1
        return $this->queue;
42
    }
43
44 1
    public function basic(): Basic
45
    {
46 1
        return $this->basic;
47
    }
48
49 1
    public function transaction(): Transaction
50
    {
51 1
        return $this->transaction;
52
    }
53
54 2
    public function closed(): bool
55
    {
56 2
        return $this->closed || !$this->connection->opened();
57
    }
58
59 1
    public function close(): void
60
    {
61 1
        if ($this->closed()) {
62 1
            return;
63
        }
64
65
        $this
66 1
            ->connection
67 1
            ->send($this->connection->protocol()->channel()->close(
68 1
                $this->number,
69 1
                new Close
70
            ))
71 1
            ->wait('channel.close-ok');
72 1
        $this->closed = true;
73 1
    }
74
}
75