Passed
Push — main ( 1fe2cd...c1deb1 )
by Dimitri
04:10
created

ConfigException   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 34
ccs 2
cts 5
cp 0.4
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A configDontExist() 0 3 1
A disabledMigrations() 0 3 1
A fileDontExist() 0 3 1
A viewAdapterConfigNotFound() 0 3 1
A notFound() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of Blitz PHP framework.
5
 *
6
 * (c) 2022 Dimitri Sitchet Tomkeu <[email protected]>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
namespace BlitzPHP\Exceptions;
13
14
/**
15
 * Exception pour la journalisation automatique.
16
 */
17
class ConfigException extends CriticalError
18
{
19
    use DebugTraceableTrait;
20
21
    /**
22
     * code d'erreur
23
     *
24
     * @var int
25
     */
26
    protected $code = 3;
27
28
    public static function disabledMigrations()
29
    {
30
        return new static(lang('Migrations.disabled'));
31
    }
32
33
    public static function configDontExist(string $config, string $file)
34
    {
35
        return new static(lang('Config.fileDoesNotExist', [$config, $file]));
36
    }
37
38
    public static function fileDontExist(string $config)
39
    {
40
        return new static(lang('Config.configFileDoesNotExist', [$config]));
41
    }
42
43
    public static function notFound(string $key)
44
    {
45 2
        return new static(lang('Config.notFound', [$key]));
46
    }
47
48
    public static function viewAdapterConfigNotFound(string $adapter)
49
    {
50 2
        return new static(lang('Config.viewAdapterConfigNotFound', [$adapter]));
51
    }
52
}
53