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

ApplicationException::forInvalidController()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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