Code Duplication    Length = 22-22 lines in 2 locations

src/Redis/Command/Compose/ApiListTrait.php 2 locations

@@ 21-42 (lines=22) @@
18
     * @override
19
     * @inheritDoc
20
     */
21
    public function blPop(array $keys, $timeout)
22
    {
23
        // TODO: Implement blPop() method.
24
        $command = Enum::BLPOP;
25
        $keys[] = $timeout;
26
        $args = $keys;
27
        $promise = $this->dispatch(Builder::build($command, $args));
28
        $promise = $promise->then(function ($value) {
29
            if (is_array($value)) {
30
                list($k,$v) = $value;
31
32
                return [
33
                    'key'=>$k,
34
                    'value'=>$v
35
                ];
36
            }
37
38
            return $value;
39
        });
40
41
        return $promise;
42
    }
43
44
    /**
45
     * @override
@@ 48-69 (lines=22) @@
45
     * @override
46
     * @inheritDoc
47
     */
48
    public function brPop(array $keys, $timeout)
49
    {
50
        // TODO: Implement brPop() method.
51
        $command = Enum::BRPOP;
52
        $keys[] = $timeout;
53
        $args = $keys;
54
        $promise = $this->dispatch(Builder::build($command, $args));
55
        $promise = $promise->then(function ($value) {
56
            if (is_array($value)) {
57
                list($k,$v) = $value;
58
59
                return [
60
                    'key'=>$k,
61
                    'value'=>$v
62
                ];
63
            }
64
65
            return $value;
66
        });
67
68
        return $promise;
69
    }
70
71
    /**
72
     * @override