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

ConfigException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 16
ccs 3
cts 6
cp 0.5
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A keyNotFound() 0 6 1
A configDirNotFound() 0 5 1
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