| Conditions | 9 |
| Paths | 9 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 9 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 215 | protected function internalExecute(string|null $rawSql): void |
|
| 27 | { |
||
| 28 | 215 | $attempt = 0; |
|
| 29 | |||
| 30 | 215 | while (true) { |
|
| 31 | try { |
||
| 32 | if ( |
||
| 33 | ++$attempt === 1 |
||
| 34 | 215 | && $this->isolationLevel !== null |
|
| 35 | 215 | && $this->db->getTransaction() === null |
|
| 36 | ) { |
||
| 37 | 1 | $this->db->transaction( |
|
| 38 | 1 | fn (ConnectionPDOInterface $db) => $this->internalExecute($rawSql), |
|
|
|
|||
| 39 | 1 | $this->isolationLevel, |
|
| 40 | ); |
||
| 41 | } else { |
||
| 42 | 215 | $this->pdoStatement?->execute(); |
|
| 43 | } |
||
| 44 | 215 | break; |
|
| 45 | 33 | } catch (PDOException $e) { |
|
| 46 | 33 | $rawSql = $rawSql ?: $this->getRawSql(); |
|
| 47 | 33 | $e = (new ConvertException($e, $rawSql))->run(); |
|
| 48 | |||
| 49 | 33 | if ($this->retryHandler === null || !($this->retryHandler)($e, $attempt)) { |
|
| 50 | 33 | 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.