Code Duplication    Length = 13-13 lines in 3 locations

src/RedisProxy.php 3 locations

@@ 222-234 (lines=13) @@
219
     * @param integer $count
220
     * @return array|boolean|null list of found keys, returns null if $iterator is 0 or '0'
221
     */
222
    public function scan(&$iterator, $pattern = null, $count = null)
223
    {
224
        if ((string)$iterator === '0') {
225
            return null;
226
        }
227
        $this->init();
228
        if ($this->driver instanceof Client) {
229
            $returned = $this->driver->scan($iterator, ['match' => $pattern, 'count' => $count]);
230
            $iterator = $returned[0];
231
            return $returned[1];
232
        }
233
        return $this->driver->scan($iterator, $pattern, $count);
234
    }
235
236
    /**
237
     * Get the value of a hash field
@@ 317-329 (lines=13) @@
314
     * @param integer $count
315
     * @return array|boolean|null list of found fields with associated values, returns null if $iterator is 0 or '0'
316
     */
317
    public function hscan($key, &$iterator, $pattern = null, $count = null)
318
    {
319
        if ((string)$iterator === '0') {
320
            return null;
321
        }
322
        $this->init();
323
        if ($this->driver instanceof Client) {
324
            $returned = $this->driver->hscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
325
            $iterator = $returned[0];
326
            return $returned[1];
327
        }
328
        return $this->driver->hscan($key, $iterator, $pattern, $count);
329
    }
330
331
    /**
332
     * Add one or more members to a set
@@ 379-391 (lines=13) @@
376
     * @param integer $count
377
     * @return array|boolean|null list of found members, returns null if $iterator is 0 or '0'
378
     */
379
    public function sscan($key, &$iterator, $pattern = null, $count = null)
380
    {
381
        if ((string)$iterator === '0') {
382
            return null;
383
        }
384
        $this->init();
385
        if ($this->driver instanceof Client) {
386
            $returned = $this->driver->sscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
387
            $iterator = $returned[0];
388
            return $returned[1];
389
        }
390
        return $this->driver->sscan($key, $iterator, $pattern, $count);
391
    }
392
393
    private function convertFalseToNull($result)
394
    {