| @@ 141-150 (lines=10) @@ | ||
| 138 | $pattern = null; |
|
| 139 | $res = $this->connection->hscan($table, $iterator, $pattern, 1000); |
|
| 140 | $res = $res ?: []; |
|
| 141 | foreach ($res as $key => $value) { |
|
| 142 | $item = [ |
|
| 143 | 'key' => $key, |
|
| 144 | 'length' => strlen($value), |
|
| 145 | 'value' => $value, |
|
| 146 | ]; |
|
| 147 | if (Filter::apply($item, $filter)) { |
|
| 148 | $totalItems++; |
|
| 149 | } |
|
| 150 | } |
|
| 151 | } while ($iterator !== 0); |
|
| 152 | $this->itemsCountCache = $totalItems; |
|
| 153 | return $this->itemsCountCache; |
|
| @@ 184-192 (lines=9) @@ | ||
| 181 | do { |
|
| 182 | $res = $this->connection->sscan($table, $iterator, null, 1000); |
|
| 183 | $res = $res ?: []; |
|
| 184 | foreach ($res as $member) { |
|
| 185 | $item = [ |
|
| 186 | 'member' => $member, |
|
| 187 | 'length' => strlen($member), |
|
| 188 | ]; |
|
| 189 | if (Filter::apply($item, $filter)) { |
|
| 190 | $totalItems++; |
|
| 191 | } |
|
| 192 | } |
|
| 193 | } while ($iterator !== 0); |
|
| 194 | return $totalItems; |
|
| 195 | } |
|