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