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.
Test Failed
Push — master ( 925ec5...ba350e )
by SignpostMarv
06:17
created

eDoesNotMatchMultiTypedArray()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 9.8666
c 0
b 0
f 0
cc 3
nc 2
nop 4
crap 3
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject;
8
9
use InvalidArgumentException;
10
11
class TypeParanoia extends TypeCertainty
12
{
13
    const INDEX_SECOND_ARG = 2;
14
15
    const INT_ARG_OFFSET = 5;
16
17
    /**
18
    * @tempalte T as class-string
19
    */
20 644
    public static function IsThingStrings(string $maybe, string $thing) : bool
21
    {
22 644
        return is_a($maybe, $thing, true);
23
    }
24
25
    /**
26
    * @param string|object $object
27
    *
28
    * @psalm-param class-string|object $object
29
    */
30
    public static function ThrowIfNotType(
31
        $object,
32
        int $argument,
33 206
        string $class,
34
        string $function,
35 206
        string ...$types
36 168
    ) : void {
37
        foreach ($types as $i => $type) {
38
            if ( ! interface_exists($type) && ! class_exists($type)) {
39 38
                throw new InvalidArgumentException(
40
                    'Argument ' .
41
                    (self::INT_ARG_OFFSET + $i) .
42 2
                    ' passed to ' .
43
                    __METHOD__ .
44 2
                    ' must be a class or interface!'
45
                );
46
            } elseif ( ! is_a($object, $type, is_string($object))) {
47
                throw new DaftObjectRepositoryTypeByClassMethodAndTypeException(
48
                    $argument,
49
                    $class,
50
                    $function,
51
                    $type,
52 14
                    is_string($object) ? $object : get_class($object)
53
                );
54
            }
55
        }
56
    }
57
58 14
    /**
59 2
    * @param string|object $object
60
    *
61
    * @psalm-param class-string<DefinesOwnIdPropertiesInterface>|DefinesOwnIdPropertiesInterface $object
62
    */
63 2
    public static function ThrowIfNotDaftObjectIdPropertiesType(
64 2
        $object,
65
        int $argument,
66
        string $class,
67
        string $function,
68 12
        string ...$types
69 12
    ) : void {
70 12
        static::ThrowIfNotType(
71 12
            $object,
72 9
            $argument,
73
            $class,
74
            $function,
75
            DefinesOwnIdPropertiesInterface::class,
76
            ...$types
77
        );
78
    }
79
}
80