| Conditions | 6 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function invoke(): bool |
||
| 34 | { |
||
| 35 | while ($this->current_retry_count <= $this->max_retry or $this->max_retry === -1) { |
||
| 36 | try { |
||
| 37 | $result = $this->chain->invoke(); |
||
| 38 | $this->current_retry_count = 0; |
||
| 39 | return $result; |
||
| 40 | } catch (\Throwable $e) { |
||
| 41 | foreach ($this->exception_names as $exception_name) { |
||
| 42 | /** @psalm-suppress DocblockTypeContradiction */ |
||
| 43 | if (is_a($e, $exception_name)) { |
||
| 44 | $this->current_retry_count++; |
||
| 45 | continue 2; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | throw $e; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | assert(isset($e)); |
||
| 52 | throw $e; |
||
| 53 | } |
||
| 55 |