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