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