Code Duplication    Length = 13-13 lines in 3 locations

src/RedisProxy.php 3 locations

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