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 — master ( fc45f0...dd0edf )
by Baptiste
02:38
created

Get   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 13 1
A __construct() 0 4 1
A __toString() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Command;
5
6
use Innmind\AMQP\{
7
    Client,
8
    Consumers,
9
    Model\Basic,
10
};
11
use Innmind\CLI\{
12
    Command,
13
    Command\Arguments,
14
    Command\Options,
15
    Environment,
16
};
17
18
final class Get implements Command
19
{
20
    private $client;
21
    private $consumers;
22
23 5
    public function __construct(Client $client, Consumers $consumers)
24
    {
25 5
        $this->client = $client;
26 5
        $this->consumers = $consumers;
27 5
    }
28
29 2
    public function __invoke(Environment $env, Arguments $arguments, Options $options): void
30
    {
31 2
        $queue = $arguments->get('queue');
32 2
        $consume = $this->consumers->get($queue);
33
34
        try {
35
            $this
36 2
                ->client
37 2
                ->channel()
38 2
                ->basic()
39 2
                ->get(new Basic\Get($queue))($consume);
40 1
        } finally {
41 2
            $this->client->close();
42
        }
43 1
    }
44
45 1
    public function __toString(): string
46
    {
47
        return <<<USAGE
48 1
innmind:amqp:get queue
49
50
Will process a single message from the given queue
51
USAGE;
52
    }
53
}
54