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 |
||
30 | 256 | protected function internalExecute(string|null $rawSql): void |
|
31 | { |
||
32 | 256 | $attempt = 0; |
|
33 | |||
34 | 256 | while (true) { |
|
35 | try { |
||
36 | if ( |
||
37 | 256 | ++$attempt === 1 |
|
38 | 256 | && $this->isolationLevel !== null |
|
39 | 256 | && $this->db->getTransaction() === null |
|
40 | ) { |
||
41 | 1 | $this->db->transaction( |
|
42 | 1 | fn (ConnectionPDOInterface $db) => $this->internalExecute($rawSql), |
|
|
|||
43 | 1 | $this->isolationLevel |
|
44 | 1 | ); |
|
45 | } else { |
||
46 | 256 | $this->pdoStatement?->execute(); |
|
47 | } |
||
48 | 255 | break; |
|
49 | 7 | } catch (PDOException $e) { |
|
50 | 7 | $rawSql = $rawSql ?: $this->getRawSql(); |
|
51 | 7 | $e = (new ConvertException($e, $rawSql))->run(); |
|
52 | |||
53 | 7 | if ($this->retryHandler === null || !($this->retryHandler)($e, $attempt)) { |
|
54 | 7 | throw $e; |
|
55 | } |
||
60 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.