Code Duplication    Length = 13-13 lines in 3 locations

src/RedisProxy.php 3 locations

@@ 448-460 (lines=13) @@
445
     * @param int $count
446
     * @return array|boolean|null list of found keys, returns null if $iterator is 0 or '0'
447
     */
448
    public function scan(&$iterator, $pattern = null, $count = null)
449
    {
450
        if ((string)$iterator === '0') {
451
            return null;
452
        }
453
        $this->init();
454
        if ($this->actualDriver() === self::DRIVER_PREDIS) {
455
            $returned = $this->driver->scan($iterator, ['match' => $pattern, 'count' => $count]);
456
            $iterator = $returned[0];
457
            return $returned[1];
458
        }
459
        return $this->driver->scan($iterator, $pattern, $count);
460
    }
461
462
    /**
463
     * Get the value of a hash field
@@ 558-570 (lines=13) @@
555
     * @param int $count
556
     * @return array|boolean|null list of found fields with associated values, returns null if $iterator is 0 or '0'
557
     */
558
    public function hscan($key, &$iterator, $pattern = null, $count = null)
559
    {
560
        if ((string)$iterator === '0') {
561
            return null;
562
        }
563
        $this->init();
564
        if ($this->actualDriver() === self::DRIVER_PREDIS) {
565
            $returned = $this->driver->hscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
566
            $iterator = $returned[0];
567
            return $returned[1];
568
        }
569
        return $this->driver->hscan($key, $iterator, $pattern, $count);
570
    }
571
572
    /**
573
     * Add one or more members to a set
@@ 618-630 (lines=13) @@
615
     * @param int $count
616
     * @return array|boolean|null list of found members, returns null if $iterator is 0 or '0'
617
     */
618
    public function sscan($key, &$iterator, $pattern = null, $count = null)
619
    {
620
        if ((string)$iterator === '0') {
621
            return null;
622
        }
623
        $this->init();
624
        if ($this->actualDriver() === self::DRIVER_PREDIS) {
625
            $returned = $this->driver->sscan($key, $iterator, ['match' => $pattern, 'count' => $count]);
626
            $iterator = $returned[0];
627
            return $returned[1];
628
        }
629
        return $this->driver->sscan($key, $iterator, $pattern, $count);
630
    }
631
632
    /**
633
     * Prepend one or multiple values to a list