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