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

Consumers::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 6
nc 2
nop 1
dl 0
loc 12
ccs 6
cts 6
cp 1
crap 3
rs 9.4285
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP;
5
6
use Innmind\Immutable\{
7
    MapInterface,
8
    Map,
9
};
10
11
final class Consumers
12
{
13
    private $consumers;
14
15 15
    public function __construct(MapInterface $consumers = null)
16
    {
17 15
        $consumers = $consumers ?? new Map('string', 'callable');
18
19
        if (
20 15
            (string) $consumers->keyType() !== 'string' ||
21 15
            (string) $consumers->valueType() !== 'callable'
22
        ) {
23 2
            throw new \TypeError('Argument 1 must be of type MapInterface<string, callable>');
24
        }
25
26 13
        $this->consumers = $consumers;
27 13
    }
28
29 2
    public function contains(string $queue): bool
30
    {
31 2
        return $this->consumers->contains($queue);
32
    }
33
34 7
    public function get(string $queue): callable
35
    {
36 7
        return $this->consumers->get($queue);
37
    }
38
}
39