| @@ 117-126 (lines=10) @@ | ||
| 114 | $pattern = null; |
|
| 115 | $res = $this->connection->hscan($table, $iterator, $pattern, 1000); |
|
| 116 | $res = $res ?: []; |
|
| 117 | foreach ($res as $key => $value) { |
|
| 118 | $item = [ |
|
| 119 | 'key' => $key, |
|
| 120 | 'length' => strlen($value), |
|
| 121 | 'value' => $value, |
|
| 122 | ]; |
|
| 123 | if (Filter::apply($item, $filter)) { |
|
| 124 | $totalItems++; |
|
| 125 | } |
|
| 126 | } |
|
| 127 | } while ($iterator !== 0); |
|
| 128 | $this->itemsCountCache = $totalItems; |
|
| 129 | return $this->itemsCountCache; |
|
| @@ 162-170 (lines=9) @@ | ||
| 159 | do { |
|
| 160 | $res = $this->connection->sscan($table, $iterator, null, 1000); |
|
| 161 | $res = $res ?: []; |
|
| 162 | foreach ($res as $member) { |
|
| 163 | $item = [ |
|
| 164 | 'member' => $member, |
|
| 165 | 'length' => strlen($member), |
|
| 166 | ]; |
|
| 167 | if (Filter::apply($item, $filter)) { |
|
| 168 | $totalItems++; |
|
| 169 | } |
|
| 170 | } |
|
| 171 | } while ($iterator !== 0); |
|
| 172 | return $totalItems; |
|
| 173 | } |
|