| Conditions | 2 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | 3 | public static function rethrow(self $exception): self |
|
| 11 | { |
||
| 12 | 3 | $original = $exception; |
|
| 13 | 3 | $messages = new Sequence; |
|
| 14 | |||
| 15 | do { |
||
| 16 | 3 | $messages = $messages->add($exception->getMessage()); |
|
| 17 | 3 | } while ($exception = $exception->getPrevious()); |
|
| 18 | |||
| 19 | 3 | throw new self( |
|
| 20 | (string) $messages |
||
| 21 | 3 | ->filter(static function(string $message): bool { |
|
| 22 | 3 | return $message !== ''; |
|
| 23 | 3 | }) |
|
| 24 | 3 | ->join('.'), |
|
| 25 | 3 | 0, |
|
| 26 | 3 | $original |
|
| 27 | ); |
||
| 30 |