| @@ 106-115 (lines=10) @@ | ||
| 103 | $pattern = null; |
|
| 104 | $res = $this->connection->hscan($table, $iterator, $pattern, 1000); |
|
| 105 | $res = $res ?: []; |
|
| 106 | foreach ($res as $key => $value) { |
|
| 107 | $item = [ |
|
| 108 | 'key' => $key, |
|
| 109 | 'length' => strlen($value), |
|
| 110 | 'value' => $value, |
|
| 111 | ]; |
|
| 112 | if (Filter::apply($item, $filter)) { |
|
| 113 | $totalItems++; |
|
| 114 | } |
|
| 115 | } |
|
| 116 | } while ($iterator !== 0); |
|
| 117 | $this->itemsCountCache = $totalItems; |
|
| 118 | return $this->itemsCountCache; |
|
| @@ 151-159 (lines=9) @@ | ||
| 148 | do { |
|
| 149 | $res = $this->connection->sscan($table, $iterator, null, 1000); |
|
| 150 | $res = $res ?: []; |
|
| 151 | foreach ($res as $member) { |
|
| 152 | $item = [ |
|
| 153 | 'member' => $member, |
|
| 154 | 'length' => strlen($member), |
|
| 155 | ]; |
|
| 156 | if (Filter::apply($item, $filter)) { |
|
| 157 | $totalItems++; |
|
| 158 | } |
|
| 159 | } |
|
| 160 | } while ($iterator !== 0); |
|
| 161 | return $totalItems; |
|
| 162 | } |
|