Exception   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 22
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Zortje\MVC\Common\Exception;
5
6
/**
7
 * Class Exception
8
 *
9
 * @package Zortje\MVC\Common\Exception
10
 */
11
class Exception extends \Exception
12
{
13
14
    /**
15
     * @var string
16
     */
17
    protected $template = '';
18
19
    /**
20
     * @param string|array|null $message Exception message
21
     * @param int               $code    Exception Code
22
     * @param null|\Exception   $previous
23
     */
24 27
    public function __construct($message, int $code = 0, \Exception $previous = null)
25
    {
26 27
        if (is_array($message)) {
27 13
            $message = vsprintf($this->template, $message);
28
        }
29
30 27
        parent::__construct($message, $code, $previous);
31 27
    }
32
}
33