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 ( 052a19...142883 )
by Baptiste
04:15
created

Get::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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);
1 ignored issue
show
Bug introduced by
It seems like $queue can also be of type Innmind\Immutable\StreamInterface; however, parameter $queue of Innmind\AMQP\Consumers::get() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

32
        $consume = $this->consumers->get(/** @scrutinizer ignore-type */ $queue);
Loading history...
33
34
        try {
35
            $this
36 2
                ->client
37 2
                ->channel()
38 2
                ->basic()
39 2
                ->get(new Basic\Get($queue))($consume);
1 ignored issue
show
Bug introduced by
It seems like $queue can also be of type Innmind\Immutable\StreamInterface; however, parameter $queue of Innmind\AMQP\Model\Basic\Get::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

39
                ->get(new Basic\Get(/** @scrutinizer ignore-type */ $queue))($consume);
Loading history...
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