Passed
Branch master (82a58b)
by Tomasz
01:54
created

InvalidArgumentException::invalidType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace ReadModel;
5
6
class InvalidArgumentException extends \InvalidArgumentException
7
{
8
    public static function filterDoesNotExist(string $name): self
9
    {
10
        return new self("Filter '$name' doesn't exist");
11
    }
12
13
    public static function binaryUuidTransformerMustBeProvided(): self
14
    {
15
        return new self('You have to provide BinaryUuidTransformer to use BinaryUuidTransformerWalker');
16
    }
17
18 1
    public static function invalidType(string $type, string $function): self
19
    {
20 1
        return new self(sprintf(
21 1
            'Type "%s" is invalid. There is no "%s" function. Fix your type or add that function to global namespace',
22 1
            $type,
23 1
            $function
24
        ));
25
    }
26
}
27