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

ApplicationException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A forUnsupportedFeature() 0 3 1
A forInvalidModule() 0 4 1
A forInvalidController() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Igni\Application\Exception;
4
5
use Igni\Exception\RuntimeException;
6
7
class ApplicationException extends RuntimeException
8
{
9
    public static function forUnsupportedFeature(): self
10
    {
11
        return new self('This feature is not supported yet.');
12
    }
13
14
    public static function forInvalidModule($module): self
15
    {
16
        $dumped = var_export($module, true);
17
        return new self("Passed module (${dumped}) is not valid module.");
18
    }
19
20
    public static function forInvalidController($controller): self
21
    {
22
        $dumped = var_export($controller, true);
23
        return new self("Passed controller (${dumped}) is not valid controller.");
24
    }
25
}
26