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

ConfigException::keyNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 1
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