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