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.

Logger   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Test Coverage

Coverage 93.55%

Importance

Changes 0
Metric Value
eloc 25
dl 0
loc 70
ccs 29
cts 31
cp 0.9355
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A maxFrameSize() 0 3 1
A close() 0 4 1
A closed() 0 3 1
A protocol() 0 3 1
A send() 0 15 1
A __construct() 0 6 1
A wait() 0 13 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 Ramsey\Uuid\Uuid;
13
use Psr\Log\LoggerInterface;
14
15
final class Logger implements ConnectionInterface
16
{
17
    private $connection;
18
    private $logger;
19
20 14
    public function __construct(
21
        ConnectionInterface $connection,
22
        LoggerInterface $logger
23
    ) {
24 14
        $this->connection = $connection;
25 14
        $this->logger = $logger;
26 14
    }
27
28 2
    public function protocol(): Protocol
29
    {
30 2
        return $this->connection->protocol();
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 2
    public function send(Frame $frame): ConnectionInterface
37
    {
38 2
        $this->logger->debug(
39 2
            'AMQP frame about to be sent',
40
            [
41 2
                'type' => $frame->type()->toInt(),
42 2
                'channel' => $frame->channel()->toInt(),
43 2
                'uuid' => $uuid = (string) Uuid::uuid4(),
44
            ]
45
        );
46
47 2
        $this->connection->send($frame);
48 2
        $this->logger->debug('AMQP frame sent', ['uuid' => $uuid]);
49
50 2
        return $this;
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56 2
    public function wait(string ...$names): Frame
57
    {
58 2
        $this->logger->debug('Waiting for AMQP frame', ['names' => $names]);
59 2
        $frame = $this->connection->wait(...$names);
60 2
        $this->logger->debug(
61 2
            'AMQP frame received',
62
            [
63 2
                'type' => $frame->type()->toInt(),
64 2
                'channel' => $frame->channel()->toInt(),
65
            ]
66
        );
67
68 2
        return $frame;
69
    }
70
71
    public function maxFrameSize(): MaxFrameSize
72
    {
73
        return $this->connection->maxFrameSize();
74
    }
75
76 2
    public function close(): void
77
    {
78 2
        $this->connection->close();
79 2
        $this->logger->debug('AMQP connection closed');
80 2
    }
81
82 2
    public function closed(): bool
83
    {
84 2
        return $this->connection->closed();
85
    }
86
}
87