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 ( 44f5b4...dc3756 )
by Baptiste
03:14
created

Logger::send()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Transport\Connection;
5
6
use Innmind\AMQP\{
7
    Transport\Connection as ConnectionInterface,
8
    Transport\Protocol,
9
    Transport\Frame,
10
    Model\Connection\MaxFrameSize
11
};
12
use Psr\Log\LoggerInterface;
13
14
final class Logger implements ConnectionInterface
15
{
16
    private $connection;
17
    private $logger;
18
19 6
    public function __construct(
20
        ConnectionInterface $connection,
21
        LoggerInterface $logger
22
    ) {
23 6
        $this->connection = $connection;
24 6
        $this->logger = $logger;
25 6
    }
26
27 1
    public function protocol(): Protocol
28
    {
29 1
        return $this->connection->protocol();
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 1
    public function send(Frame $frame): ConnectionInterface
36
    {
37 1
        $this->logger->debug(
38 1
            'AMQP frame about to be sent',
39
            [
40 1
                'type' => $frame->type()->toInt(),
41 1
                'channel' => $frame->channel()->toInt(),
42 1
                'binary' => (string) $frame,
43
            ]
44
        );
45
46 1
        $this->connection->send($frame);
47 1
        $this->logger->debug('AMQP frame sent');
48
49 1
        return $this;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55 1
    public function wait(string ...$names): Frame
56
    {
57 1
        $this->logger->debug('Waiting for AMQP frame', ['names' => $names]);
58 1
        $frame = $this->connection->wait(...$names);
59 1
        $this->logger->debug(
60 1
            'AMQP frame received',
61
            [
62 1
                'type' => $frame->type()->toInt(),
63 1
                'channel' => $frame->channel()->toInt(),
64 1
                'binary' => (string) $frame,
65
            ]
66
        );
67
68 1
        return $frame;
69
    }
70
71
    public function maxFrameSize(): MaxFrameSize
72
    {
73
        return $this->connection->maxFrameSize();
74
    }
75
76 1
    public function close(): void
77
    {
78 1
        $this->connection->close();
79 1
        $this->logger->debug('AMQP connection closed');
80 1
    }
81
82 1
    public function closed(): bool
83
    {
84 1
        return $this->connection->closed();
85
    }
86
}
87