ClassNotFoundException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 15
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A couldNotFindClass() 0 3 1
A wrapException() 0 3 1
A wrapExceptionForExtendTag() 0 3 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Annotations\Exceptions;
5
6
7
use InvalidArgumentException;
8
9
class ClassNotFoundException extends InvalidArgumentException
10
{
11
    public static function couldNotFindClass(string $className): self
12
    {
13
        return new self("Could not autoload class '$className'");
14
    }
15
16
    public static function wrapException(self $e, string $className): self
17
    {
18
        return new self($e->getMessage()." defined in @Type annotation of class '$className'");
19
    }
20
21
    public static function wrapExceptionForExtendTag(self $e, string $className): self
22
    {
23
        return new self($e->getMessage()." defined in @ExtendType annotation of class '$className'");
24
    }
25
}
26