Conditions | 4 |
Paths | 6 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.0218 |
Changes | 0 |
1 | <?php |
||
28 | 1 | public static function fromException(Throwable $previous, string $formula, string $message = null): FormulaEngineException |
|
29 | { |
||
30 | 1 | if ($previous !== null) { |
|
31 | 1 | if ($message !== null) { |
|
32 | $message .= ': '; |
||
33 | } |
||
34 | |||
35 | 1 | $message .= $previous->getMessage(); |
|
36 | } |
||
37 | |||
38 | 1 | $exception = new static($message, 0, $previous); |
|
39 | 1 | if ($formula !== null) { |
|
40 | 1 | $exception->formula = $formula; |
|
41 | } |
||
42 | |||
43 | 1 | return $exception; |
|
44 | } |
||
45 | |||
62 |