| Conditions | 4 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 4.128 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public static function fromException(Throwable $previous, string $formula, string $message = null): FormulaEngineException |
||
| 22 | { |
||
| 23 | if ($previous !== null) { |
||
| 24 | if ($message !== null) { |
||
| 25 | $message .= ': '; |
||
| 26 | } |
||
| 27 | |||
| 28 | 1 | $message .= $previous->getMessage(); |
|
| 29 | } |
||
| 30 | 1 | ||
| 31 | 1 | $exception = new static($message, 0, $previous); |
|
| 32 | if ($formula !== null) { |
||
| 33 | $exception->formula = $formula; |
||
| 34 | } |
||
| 35 | 1 | ||
| 36 | return $exception; |
||
| 37 | } |
||
| 38 | 1 | ||
| 55 |