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 ( b12bea...82d40b )
by Baptiste
05:47
created

assertMap()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4

Importance

Changes 0
Metric Value
cc 4
eloc 7
nc 4
nop 4
dl 0
loc 13
ccs 6
cts 6
cp 1
crap 4
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable;
5
6
/**
7
 * @throws TypeError
8
 */
9
function assertSet(string $type, SetInterface $set, int $position = null): void
10
{
11 2
    $message = '';
12
13 2
    if (is_int($position)) {
14 2
        $message = "Argument $position must be of type SetInterface<$type>";
15
    }
16
17 2
    if ((string) $set->type() !== $type) {
18 2
        throw new \TypeError($message);
19
    }
20 2
}
21
22
/**
23
 * @throws TypeError
24
 */
25
function assertMap(string $key, string $value, MapInterface $map, int $position = null): void
26
{
27 2
    $message = '';
28
29 2
    if (is_int($position)) {
30 2
        $message = "Argument $position must be of type MapInterface<$key, $value>";
31
    }
32
33
    if (
34 2
        (string) $map->keyType() !== $key ||
35 2
        (string) $map->valueType() !== $value
36
    ) {
37 2
        throw new \TypeError($message);
38
    }
39 2
}
40
41
/**
42
 * @throws TypeError
43
 */
44
function assertStream(string $type, StreamInterface $stream, int $position = null): void
45
{
46 2
    $message = '';
47
48 2
    if (is_int($position)) {
49 2
        $message = "Argument $position must be of type StreamInterface<$type>";
50
    }
51
52 2
    if ((string) $stream->type() !== $type) {
53 2
        throw new \TypeError($message);
54
    }
55
}
56