| Conditions | 9 |
| Paths | 9 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 9 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 613 | protected function internalExecute(string|null $rawSql): void |
|
| 28 | { |
||
| 29 | 613 | $attempt = 0; |
|
| 30 | |||
| 31 | 613 | while (true) { |
|
| 32 | try { |
||
| 33 | if ( |
||
| 34 | 613 | ++$attempt === 1 |
|
| 35 | 613 | && $this->isolationLevel !== null |
|
| 36 | 613 | && $this->db->getTransaction() === null |
|
| 37 | ) { |
||
| 38 | 1 | $this->db->transaction( |
|
| 39 | 1 | fn (ConnectionPDOInterface $db) => $this->internalExecute($rawSql), |
|
|
|
|||
| 40 | 1 | $this->isolationLevel |
|
| 41 | 1 | ); |
|
| 42 | } else { |
||
| 43 | 613 | $this->pdoStatement?->execute(); |
|
| 44 | } |
||
| 45 | 612 | break; |
|
| 46 | 30 | } catch (PDOException $e) { |
|
| 47 | 30 | $rawSql = $rawSql ?: $this->getRawSql(); |
|
| 48 | 30 | $e = (new ConvertException($e, $rawSql))->run(); |
|
| 49 | |||
| 50 | 30 | if ($this->retryHandler === null || !($this->retryHandler)($e, $attempt)) { |
|
| 51 | 30 | throw $e; |
|
| 52 | } |
||
| 62 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.