Passed
Pull Request — master (#8)
by Brian
06:08
created

MissingAllowedTypeException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 28
ccs 5
cts 5
cp 1
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
/**
3
 * MissingAllowedTypeException
4
 */
5
6
namespace Fr3nch13\Jira\Exception;
7
8
use Fr3nch13\Jira\Exception\Exception as BaseException;
9
10
/**
11
 * Missing Allowed Type Exception
12
 *
13
 * Throw when the JiraProject can't find a defined allowed type.
14
 */
15
class MissingAllowedTypeException extends BaseException
16
{
17
    /**
18
     * Throw a 404 when allowed type is missing.
19
     * @var int
20
     */
21
    protected $_defaultCode = 404;
22
23
    /**
24
     * Constructor.
25
     *
26
     * Allows you to create exceptions that are treated as framework errors and disabled
27
     * when debug mode is off.
28
     *
29
     * @param string|array $message Either the string of the error message, or an array of attributes
30
     *   that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
31
     * @param int|null $code The code of the error, is also the HTTP status code for the error.
32
     * @param \Exception|null $previous the previous exception.
33
     */
34 2
    public function __construct($message = '', $code = null, $previous = null)
35
    {
36 2
        $this->_messageTemplate = __('Unknown Allowed Type: %s');
37
38 2
        if (is_string($message)) {
39 2
            $message = [0 => $message];
40
        }
41
42 2
        parent::__construct($message, $code, $previous);
43 2
    }
44
}
45