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.

InvalidArgumentException::invalidType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
crap 1
1
<?php
2
3
/**
4
 * @license https://github.com/f500/equatable/blob/master/LICENSE MIT
5
 */
6
7
declare(strict_types=1);
8
9
namespace F500\Equatable\Exceptions;
10
11
use InvalidArgumentException as BaseException;
12
13
/**
14
 * @copyright Copyright (c) 2015 Future500 B.V.
15
 * @author    Jasper N. Brouwer <[email protected]>
16
 */
17
final class InvalidArgumentException extends BaseException
18
{
19 9
    public static function invalidType(string $argument, string $expectedType, $actualValue): self
20
    {
21 9
        return self::create(
22 9
            'Argument $%s must be of type %s, %s given',
23 9
            $argument,
24 9
            $expectedType,
25 9
            $actualValue
26
        );
27
    }
28
29 15
    public static function invalidValueInArray(string $argument, string $expectedType, $actualValue): self
30
    {
31 15
        return self::create(
32 15
            'Each value in argument $%s must be of type %s, %s given',
33 15
            $argument,
34 15
            $expectedType,
35 15
            $actualValue
36
        );
37
    }
38
39 12
    public static function invalidKeyInArray(string $argument, string $expectedType, $actualValue): self
40
    {
41 12
        return self::create(
42 12
            'Each key in argument $%s must be of type %s, %s given',
43 12
            $argument,
44 12
            $expectedType,
45 12
            $actualValue
46
        );
47
    }
48
49 36
    private static function create(string $message, string $argument, string $expectedType, $actualValue): self
50
    {
51 36
        if (is_object($actualValue)) {
52 9
            $actualType = get_class($actualValue);
53 27
        } elseif (is_resource($actualValue)) {
54 9
            $actualType = get_resource_type($actualValue);
55
        } else {
56 18
            $actualType = gettype($actualValue);
57
        }
58
59 36
        return new self(sprintf($message, $argument, $expectedType, $actualType));
60
    }
61
}
62