Code Duplication    Length = 13-13 lines in 3 locations

src/RedisProxy.php 3 locations

@@ 262-274 (lines=13) @@
259
     * @param integer $count
260
     * @return array|boolean|null list of found keys, returns null if $iterator is 0 or '0'
261
     */
262
    public function scan(&$iterator, $pattern = null, $count = null)
263
    {
264
        if ((string)$iterator === '0') {
265
            return null;
266
        }
267
        $this->init();
268
        if ($this->actualDriver() === self::DRIVER_PREDIS) {
269
            $returned = $this->driver->scan($iterator, ['match' => $pattern, 'count' => $count]);
270
            $iterator = $returned[0];
271
            return $returned[1];
272
        }
273
        return $this->driver->scan($iterator, $pattern, $count);
274
    }
275
276
    /**
277
     * Get the value of a hash field
@@ 378-390 (lines=13) @@
375
     * @param integer $count
376
     * @return array|boolean|null list of found fields with associated values, returns null if $iterator is 0 or '0'
377
     */
378
    public function hscan($key, &$iterator, $pattern = null, $count = null)
379
    {
380
        if ((string)$iterator === '0') {
381
            return null;
382
        }
383
        $this->init();
384
        if ($this->actualDriver() === self::DRIVER_PREDIS) {
385
            $returned = $this->driver->hscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
386
            $iterator = $returned[0];
387
            return $returned[1];
388
        }
389
        return $this->driver->hscan($key, $iterator, $pattern, $count);
390
    }
391
392
    /**
393
     * Add one or more members to a set
@@ 440-452 (lines=13) @@
437
     * @param integer $count
438
     * @return array|boolean|null list of found members, returns null if $iterator is 0 or '0'
439
     */
440
    public function sscan($key, &$iterator, $pattern = null, $count = null)
441
    {
442
        if ((string)$iterator === '0') {
443
            return null;
444
        }
445
        $this->init();
446
        if ($this->actualDriver() === self::DRIVER_PREDIS) {
447
            $returned = $this->driver->sscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
448
            $iterator = $returned[0];
449
            return $returned[1];
450
        }
451
        return $this->driver->sscan($key, $iterator, $pattern, $count);
452
    }
453
454
    private function convertFalseToNull($result)
455
    {