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