MissingConfigException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * MissingConfigException
6
 */
7
8
namespace Fr3nch13\Jira\Exception;
9
10
/**
11
 * Missing Config Exception
12
 *
13
 * Throw when a config variable is missing.
14
 */
15
class MissingConfigException extends JiraBaseException
16
{
17
    /**
18
     * @var int Throw a 500 when config variable is missing.
19
     */
20
    protected $_defaultCode = 500;
21
22
    /**
23
     * Constructor.
24
     *
25
     * Allows you to create exceptions that are treated as framework errors and disabled
26
     * when debug mode is off.
27
     *
28
     * @param string|array<int, string> $message Either the string of the error message, or an array of attributes
29
     *   that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
30
     * @param int|null $code The code of the error, is also the HTTP status code for the error.
31
     * @param \Exception|null $previous the previous exception.
32
     */
33 9
    public function __construct($message = '', $code = null, $previous = null)
34
    {
35 9
        $this->_messageTemplate = __('Seems that the config key `Jira.%s` is not set.');
36
37 9
        parent::__construct($message, $code, $previous);
38
    }
39
}
40