Passed
Pull Request — master (#1)
by ANTHONIUS
01:35
created

WithConfigurationException::configFileNotExists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
rs 10
c 1
b 0
f 1
1
<?php
2
3
/*
4
 * This file is part of the doyo/mezzio-testing project.
5
 *
6
 * (c) Anthonius Munthi <https://itstoni.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Doyo\Mezzio\Testing\Exception;
15
16
use Exception;
17
18
class WithConfigurationException extends Exception
19
{
20
    public static function configDirNotExists(string $path): self
21
    {
22
        return new self(sprintf(
23
            'Config directory "%s" not exists.',
24
            $path
25
        ));
26
    }
27
28
    public static function configFileNotExists(string $dir, string $fileName): self
29
    {
30
        return new self(sprintf(
31
            'Configuration file "%s" not found in directory: "%s"',
32
            $fileName,
33
            $dir
34
        ));
35
    }
36
37
    public static function containerFileNotExist(string $dir, string $fileName): self
38
    {
39
        return new self(sprintf(
40
            'Container config file "%s" not found in directory: "%s"',
41
            $fileName,
42
            $dir
43
        ));
44
    }
45
46
    public static function pipelineFileNotExists(string $dir, string $fileName): self
47
    {
48
        return new self(sprintf(
49
            'Pipeline config file "%s" not found in directory: "%s"',
50
            $fileName,
51
            $dir
52
        ));
53
    }
54
55
    public static function routesFileNotExists(string $dir, string $fileName): self
56
    {
57
        return new self(sprintf(
58
            'Routes config file "%s" not found in directory: "%s"',
59
            $fileName,
60
            $dir
61
        ));
62
    }
63
}
64