Passed
Pull Request — master (#182)
by Arman
03:14
created

LoggerException::unsupportedAdapter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * Quantum PHP Framework
4
 *
5
 * An open source software development framework for PHP
6
 *
7
 * @package Quantum
8
 * @author Arman Ag. <[email protected]>
9
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
10
 * @link http://quantum.softberg.org/
11
 * @since 2.9.5
12
 */
13
14
namespace Quantum\Logger;
15
16
use Exception;
17
use Quantum\Exceptions\LangException;
18
19
/**
20
 * Class LoggerException
21
 * @package Quantum\Logger
22
 */
23
class LoggerException extends Exception
24
{
25
    /**
26
     * @param string $name
27
     * @return LoggerException
28
     * @throws LangException
29
     */
30
    public static function unsupportedAdapter(string $name): LoggerException
31
    {
32
        return new static(t('exception.not_supported_adapter', $name));
33
    }
34
35
    /**
36
     * @param string $name
37
     * @return LoggerException
38
     * @throws LangException
39
     */
40
    public static function logPathIsNotDirectory(string $name): LoggerException
41
    {
42
        return new static(t('exception.log_path_is_not_directory', $name));
43
    }
44
45
    /**
46
     * @param string $name
47
     * @return LoggerException
48
     * @throws LangException
49
     */
50
    public static function logPathIsNotFile(string $name): LoggerException
51
    {
52
        return new static(t('exception.log_path_is_not_file', $name));
53
    }
54
}