Skip to content

Commit dae0aa0

Browse files
committed
Simplify IterableDataReader $limit property
1 parent 211b044 commit dae0aa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Reader/Iterable/IterableDataReader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class IterableDataReader implements DataReaderInterface
3737
protected iterable $data;
3838
private ?Sort $sort = null;
3939
private ?FilterInterface $filter = null;
40-
private ?int $limit = null;
40+
private int $limit = 0;
4141
private int $offset = 0;
4242

4343
private array $filterProcessors = [];
@@ -146,7 +146,7 @@ public function read(): array
146146

147147
foreach ($sortedData as $item) {
148148
// do not return more than limit items
149-
if ($this->limit !== null && count($data) === $this->limit) {
149+
if ($this->limit > 0 && count($data) === $this->limit) {
150150
break;
151151
}
152152

0 commit comments

Comments
 (0)