Conditions | 6 |
Paths | 7 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 3 | protected function getRows(): array |
|
23 | { |
||
24 | 3 | $rows = []; |
|
25 | 3 | $count = 0; |
|
26 | |||
27 | try { |
||
28 | do { |
||
29 | 3 | $this->dataReader?->next(); |
|
30 | /** @psalm-var array|bool $row */ |
||
31 | 3 | $row = $this->dataReader?->current(); |
|
32 | 3 | } while ($row && ($rows[] = $row) && ++$count < $this->batchSize); |
|
33 | 3 | } catch (PDOException $e) { |
|
34 | /** @psalm-var array{0:string, 1:int|null, 2:string} $errorInfo */ |
||
35 | 3 | $errorInfo = $e->errorInfo; |
|
36 | 3 | $errorInfo[1] ??= null; |
|
37 | 3 | $rows = $errorInfo[1] !== $this->mssqlNoMoreRowsErrorCode ? throw $e : []; |
|
38 | } |
||
39 | |||
40 | 3 | return $rows; |
|
41 | } |
||
43 |