Completed
Pull Request — master (#44)
by David
01:59
created

ClassNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A couldNotFindClass() 0 3 1
A wrapException() 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