InvalidArgumentException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 18
ccs 5
cts 9
cp 0.5556
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A binaryUuidTransformerMustBeProvided() 0 3 1
A filterDoesNotExist() 0 3 1
A invalidType() 0 6 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