Code Duplication    Length = 22-22 lines in 2 locations

src/Redis/Redis.php 2 locations

@@ 409-430 (lines=22) @@
406
        return $this->dispatch(Builder::build($command, $args));
407
    }
408
409
    public function blPop(array $keys, $timeout)
410
    {
411
        // TODO: Implement blPop() method.
412
        $command = Enum::BLPOP;
413
        $keys[] = $timeout;
414
        $args = $keys;
415
        $promise = $this->dispatch(Builder::build($command, $args));
416
        $promise = $promise->then(function ($value) {
417
            if (is_array($value)) {
418
                list($k,$v) = $value;
419
420
                return [
421
                    'key'=>$k,
422
                    'value'=>$v
423
                ];
424
            }
425
426
            return $value;
427
        });
428
429
        return $promise;
430
    }
431
432
    public function brPop(array $keys, $timeout)
433
    {
@@ 432-453 (lines=22) @@
429
        return $promise;
430
    }
431
432
    public function brPop(array $keys, $timeout)
433
    {
434
        // TODO: Implement brPop() method.
435
        $command = Enum::BRPOP;
436
        $keys[] = $timeout;
437
        $args = $keys;
438
        $promise = $this->dispatch(Builder::build($command, $args));
439
        $promise = $promise->then(function ($value) {
440
            if (is_array($value)) {
441
                list($k,$v) = $value;
442
443
                return [
444
                    'key'=>$k,
445
                    'value'=>$v
446
                ];
447
            }
448
449
            return $value;
450
        });
451
452
        return $promise;
453
    }
454
455
    public function brPopLPush($src, $dst, $timeout)
456
    {