Passed
Push — master ( e297c9...6645eb )
by Dawid
02:47
created

ControllerException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A forUndefinedController() 0 3 1
A forMissingOption() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Igni\Application\Exception;
4
5
use Igni\Exception\RuntimeException;
6
use Psr\Container\NotFoundExceptionInterface;
7
8
class ControllerException extends RuntimeException implements NotFoundExceptionInterface
9
{
10
    public static function forUndefinedController(string $controller): ControllerException
11
    {
12
        return new self("Controller ${controller} not found.");
13
    }
14
15
    public static function forMissingOption(string $option): ControllerException
16
    {
17
        return new self("Missing option `${option}` not found.");
18
    }
19
}
20