| Conditions | 9 |
| Paths | 9 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 9 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 260 | protected function internalExecute(string|null $rawSql): void |
|
| 41 | { |
||
| 42 | 260 | $attempt = 0; |
|
| 43 | |||
| 44 | 260 | while (true) { |
|
| 45 | try { |
||
| 46 | if ( |
||
| 47 | 260 | ++$attempt === 1 |
|
| 48 | 260 | && $this->isolationLevel !== null |
|
| 49 | 260 | && $this->db->getTransaction() === null |
|
| 50 | ) { |
||
| 51 | 1 | $this->db->transaction( |
|
| 52 | 1 | fn (ConnectionPDOInterface $db) => $this->internalExecute($rawSql), |
|
|
|
|||
| 53 | 1 | $this->isolationLevel |
|
| 54 | 1 | ); |
|
| 55 | } else { |
||
| 56 | 260 | $this->pdoStatement?->execute(); |
|
| 57 | } |
||
| 58 | 260 | break; |
|
| 59 | 8 | } catch (Exception $e) { |
|
| 60 | 8 | $rawSql = $rawSql ?: $this->getRawSql(); |
|
| 61 | 8 | $e = (new ConvertException($e, $rawSql))->run(); |
|
| 62 | |||
| 63 | 8 | if ($this->retryHandler === null || !($this->retryHandler)($e, $attempt)) { |
|
| 64 | 8 | throw $e; |
|
| 65 | } |
||
| 70 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.