ClassNameException   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 missingMethod() 0 3 1
A missingImplementation() 0 3 1
A classDoesNotExist() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Comquer\Reflection\ClassName;
4
5
use RuntimeException;
6
7
class ClassNameException extends RuntimeException
8
{
9
    public static function classDoesNotExist(string $className) : self
10
    {
11
        return new self("Class $className does not exist");
12
    }
13
14
    public static function missingMethod(string $className, string $methodName): self
15
    {
16
        return new self("Class $className is expected to implement method `$methodName` but it doesn't");
17
    }
18
19
    public static function missingImplementation(string $className, string $interfaceName)
20
    {
21
        return new self("Class $className is expected to implement interface `$interfaceName` but it doesn't");
22
    }
23
}