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