Code Duplication    Length = 10-10 lines in 4 locations

src/RedisProxy.php 4 locations

@@ 158-167 (lines=10) @@
155
        return $this->del(...$key);
156
    }
157
158
    public function scan(&$iterator, $pattern = null, $count = null)
159
    {
160
        $this->init();
161
        if ($this->driver instanceof Client) {
162
            $returned = $this->driver->scan($iterator, ['match' => $pattern, 'count' => $count]);
163
            $iterator = $returned[0];
164
            return $returned[1];
165
        }
166
        return $this->driver->scan($iterator, $pattern, $count);
167
    }
168
169
    public function hget($key, $field)
170
    {
@@ 179-188 (lines=10) @@
176
        return $result;
177
    }
178
179
    public function hscan($key, &$iterator, $pattern = null, $count = null)
180
    {
181
        $this->init();
182
        if ($this->driver instanceof Client) {
183
            $returned = $this->driver->hscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
184
            $iterator = $returned[0];
185
            return $returned[1];
186
        }
187
        return $this->driver->hscan($key, $iterator, $pattern, $count);
188
    }
189
190
    public function zscan($key, &$iterator, $pattern = null, $count = null)
191
    {
@@ 190-199 (lines=10) @@
187
        return $this->driver->hscan($key, $iterator, $pattern, $count);
188
    }
189
190
    public function zscan($key, &$iterator, $pattern = null, $count = null)
191
    {
192
        $this->init();
193
        if ($this->driver instanceof Client) {
194
            $returned = $this->driver->zscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
195
            $iterator = $returned[0];
196
            return $returned[1];
197
        }
198
        return $this->driver->zscan($key, $iterator, $pattern, $count);
199
    }
200
201
    public function sscan($key, &$iterator, $pattern = null, $count = null)
202
    {
@@ 201-210 (lines=10) @@
198
        return $this->driver->zscan($key, $iterator, $pattern, $count);
199
    }
200
201
    public function sscan($key, &$iterator, $pattern = null, $count = null)
202
    {
203
        $this->init();
204
        if ($this->driver instanceof Client) {
205
            $returned = $this->driver->sscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
206
            $iterator = $returned[0];
207
            return $returned[1];
208
        }
209
        return $this->driver->sscan($key, $iterator, $pattern, $count);
210
    }
211
}
212