InvalidPlugin::configurationFileNotFound()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Stitcher\Exception;
4
5
use Exception;
6
7
class InvalidPlugin extends Exception
8
{
9
    public static function doesntImplementPluginInterface(string $class): InvalidPlugin
10
    {
11
        return new self("Plugin `{$class}` doesn't implement `Stitcher\Plugin`");
12
    }
13
14
    public static function configurationFileNotFound(string $class, string $configurationPath): InvalidPlugin
15
    {
16
        return new self("Configuration file for plugin `{$class}` not found. Searched for `{$configurationPath}`.");
17
    }
18
19
    public static function configurationMustBeArray(string $class, string $configurationPath): InvalidPlugin
20
    {
21
        return new self("Configuration file for plugin `{$class}` must return an array. Searched in `{$configurationPath}`.");
22
    }
23
24
    public static function serviceFileNotFound(string $class, string $servicePath): InvalidPlugin
25
    {
26
        return new self("Service file for plugin `{$class}` not found. Searched for `{$servicePath}`.");
27
    }
28
}
29