Passed
Push — master ( 7773a0...e045e9 )
by Chema
02:46
created

ConfigException::configDirNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\Exception;
6
7
use RuntimeException;
8
9
final class ConfigException extends RuntimeException
10
{
11
    public static function configDirNotFound(string $rootDir): self
12
    {
13
        throw new self(sprintf(
14
            '"config" directory not found in %s directory',
15
            $rootDir
16
        ));
17
    }
18
19 1
    public static function keyNotFound(string $key, string $class): self
20
    {
21 1
        return new self(sprintf(
22 1
            'Could not find config key "%s" in "%s"',
23
            $key,
24
            $class
25
        ));
26
    }
27
}
28