Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.128 |
Changes | 0 |
1 | <?php |
||
33 | 1 | public function __construct( |
|
34 | string $message = '', |
||
35 | int $code = 0, |
||
36 | Throwable $previous = null, |
||
37 | array $data = null |
||
38 | ) { |
||
39 | 1 | if ($previous !== null && $data === null) { |
|
40 | 1 | $this->data = [ |
|
41 | 1 | 'exception' => get_class($previous), |
|
42 | 1 | 'code' => $previous->getCode(), |
|
43 | 1 | 'file' => $previous->getFile(), |
|
44 | 1 | 'line' => $previous->getLine(), |
|
45 | ]; |
||
46 | } elseif ($data !== null) { |
||
47 | $this->data = $data; |
||
48 | } |
||
49 | |||
50 | 1 | parent::__construct($message, $code, $previous); |
|
51 | 1 | } |
|
61 |