Code Duplication    Length = 8-9 lines in 34 locations

src/Redis/Command/Compose/ApiGeospatialTrait.php 3 locations

@@ 21-29 (lines=9) @@
18
     * @override
19
     * @inheritDoc
20
     */
21
    public function geoAdd($key, array $coordinates)
22
    {
23
        // TODO: Implement geoAdd() method.
24
        $command = Enum::GEOADD;
25
        $args = [$key];
26
        $args = array_merge($args, $coordinates);
27
28
        return $this->dispatch(Builder::build($command, $args));
29
    }
30
31
    /**
32
     * @override
@@ 45-53 (lines=9) @@
42
     * @override
43
     * @inheritDoc
44
     */
45
    public function geoPos($key, ...$members)
46
    {
47
        // TODO: Implement geoPos() method.
48
        $command = Enum::GEOPOS;
49
        $args = [$key];
50
        $args = array_merge($args, $members);
51
52
        return $this->dispatch(Builder::build($command, $args));
53
    }
54
55
    /**
56
     * @override
@@ 59-66 (lines=8) @@
56
     * @override
57
     * @inheritDoc
58
     */
59
    public function geoDist($key, $memberA, $memberB, $unit)
60
    {
61
        // TODO: Implement geoDist() method.
62
        $command = Enum::GEODIST;
63
        $args = [$key, $memberA, $memberB ,$unit];
64
65
        return $this->dispatch(Builder::build($command, $args));
66
    }
67
68
    /**
69
     * @override

src/Redis/Command/Compose/ApiHyperLogTrait.php 1 location

@@ 21-29 (lines=9) @@
18
     * @override
19
     * @inheritDoc
20
     */
21
    public function pFAdd($key, ...$elements)
22
    {
23
        // TODO: Implement pFAdd() method.
24
        $command = Enum::PFADD;
25
        $args = [$key];
26
        $args = array_merge($args, $elements);
27
28
        return $this->dispatch(Builder::build($command, $args));
29
    }
30
31
    /**
32
     * @override

src/Redis/Command/Compose/ApiKeyValTrait.php 7 locations

@@ 83-90 (lines=8) @@
80
     * @override
81
     * @inheritDoc
82
     */
83
    public function bitOp($operation, $dstKey, $srcKey, ...$keys)
84
    {
85
        $command = Enum::BITOP;
86
        $args = [$operation, $dstKey, $srcKey];
87
        $args = array_merge($args, $keys);
88
89
        return $this->dispatch(Builder::build($command, $args));
90
    }
91
92
    /**
93
     * @override
@@ 292-300 (lines=9) @@
289
     * @override
290
     * @inheritDoc
291
     */
292
    public function mGet($key, ...$values)
293
    {
294
        // TODO: Implement mGet() method.
295
        $command = Enum::MGET;
296
        $args = [$key];
297
        $args = array_merge($args, $values);
298
299
        return $this->dispatch(Builder::build($command, $args));
300
    }
301
302
    /**
303
     * @override
@@ 371-379 (lines=9) @@
368
     * @override
369
     * @inheritDoc
370
     */
371
    public function exists($key, ...$keys)
372
    {
373
        // TODO: Implement exists() method.
374
        $command = Enum::EXISTS;
375
        $args = [$key];
376
        $args = array_merge($args, $keys);
377
378
        return $this->dispatch(Builder::build($command, $args));
379
    }
380
381
    /**
382
     * @override
@@ 449-456 (lines=8) @@
446
     * @override
447
     * @inheritDoc
448
     */
449
    public function touch($key, ...$keys)
450
    {
451
        $command = Enum::TOUCH;
452
        $args = [$key];
453
        $args = array_merge($args, $keys);
454
455
        return $this->dispatch(Builder::build($command, $args));
456
    }
457
458
    /**
459
     * @override
@@ 487-494 (lines=8) @@
484
     * @override
485
     * @inheritDoc
486
     */
487
    public function unLink($key, ...$keys)
488
    {
489
        $command = Enum::UNLINK;
490
        $args = [$key];
491
        $args = array_merge($args, $keys);
492
493
        return $this->dispatch(Builder::build($command, $args));
494
    }
495
496
    /**
497
     * @override
@@ 587-594 (lines=8) @@
584
     * @override
585
     * @inheritDoc
586
     */
587
    public function scan($cursor, array $options = [])
588
    {
589
        $command = Enum::SCAN;
590
        $args = [$cursor];
591
        $args = array_merge($args, $options);
592
593
        return $this->dispatch(Builder::build($command, $args));
594
    }
595
596
    /**
597
     * @override
@@ 600-608 (lines=9) @@
597
     * @override
598
     * @inheritDoc
599
     */
600
    public function sort($key, array $options = [])
601
    {
602
        // TODO: Implement sort() method.
603
        $command = Enum::SORT;
604
        $args = [$key];
605
        $args = array_merge($args, $options);
606
607
        return $this->dispatch(Builder::build($command, $args));
608
    }
609
}
610

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

@@ 101-108 (lines=8) @@
98
     * @override
99
     * @inheritDoc
100
     */
101
    public function lInsert($key, $action, $pivot, $value)
102
    {
103
        // TODO: Implement lInsert() method.
104
        $command = Enum::LINSERT;
105
        $args = [$key, $action, $pivot, $value];
106
107
        return $this->dispatch(Builder::build($command, $args));
108
    }
109
110
    /**
111
     * @override
@@ 236-243 (lines=8) @@
233
     * @override
234
     * @inheritDoc
235
     */
236
    public function rPush($key, ...$values)
237
    {
238
        $command = Enum::RPUSH;
239
        $args = [$key];
240
        $args = array_merge($args, $values);
241
242
        return $this->dispatch(Builder::build($command, $args));
243
    }
244
245
    /**
246
     * @override

src/Redis/Command/Compose/ApiSetHashTrait.php 3 locations

@@ 21-28 (lines=8) @@
18
     * @override
19
     * @inheritDoc
20
     */
21
    public function hDel($key, ...$fields)
22
    {
23
        $command = Enum::HDEL;
24
        $args = [$key];
25
        $args = array_merge($args, $fields);
26
27
        return $this->dispatch(Builder::build($command, $args));
28
    }
29
30
    /**
31
     * @override
@@ 119-126 (lines=8) @@
116
     * @override
117
     * @inheritDoc
118
     */
119
    public function hMGet($key, ...$fields)
120
    {
121
        $command = Enum::HMGET;
122
        $args = [$key];
123
        $args = array_merge($args, $fields);
124
125
        return $this->dispatch(Builder::build($command, $args));
126
    }
127
128
    /**
129
     * @override
@@ 200-208 (lines=9) @@
197
     * @override
198
     * @inheritDoc
199
     */
200
    public function hScan($key, $cursor, array $options = [])
201
    {
202
        // TODO: Implement hScan() method.
203
        $command = Enum::HSCAN;
204
        $args = [$key, $cursor];
205
        $args = array_merge($args, $options);
206
207
        return $this->dispatch(Builder::build($command, $args));
208
    }
209
210
    /**
211
     * @inheritDoc

src/Redis/Command/Compose/ApiSetSortedTrait.php 9 locations

@@ 123-130 (lines=8) @@
120
     * @override
121
     * @inheritDoc
122
     */
123
    public function zRangeByLex($key, $min, $max, array $options = [])
124
    {
125
        $command = Enum::ZRANGEBYLEX;
126
        $args = [$key, $min, $max];
127
        $args = array_merge($args,$options);
128
129
        return $this->dispatch(Builder::build($command, $args));
130
    }
131
132
    /**
133
     * @override
@@ 136-143 (lines=8) @@
133
     * @override
134
     * @inheritDoc
135
     */
136
    public function zRevRangeByLex($key, $max, $min, array $options = [])
137
    {
138
        $command = Enum::ZREVRANGEBYLEX;
139
        $args = [$key, $max,$min];
140
        $args = array_merge($args,$options);
141
142
        return $this->dispatch(Builder::build($command, $args));
143
    }
144
145
    /**
146
     * @override
@@ 149-156 (lines=8) @@
146
     * @override
147
     * @inheritDoc
148
     */
149
    public function zRangeByScore($key, $min, $max, array $options = [])
150
    {
151
        $command = Enum::ZRANGEBYSCORE;
152
        $args = [$key, $min,$max];
153
        $args = array_merge($args, $options);
154
155
        return $this->dispatch(Builder::build($command, $args));
156
    }
157
158
    /**
159
     * @override
@@ 174-181 (lines=8) @@
171
     * @override
172
     * @inheritDoc
173
     */
174
    public function zRem($key, ...$members)
175
    {
176
        $command = Enum::ZREM;
177
        $args = [$key];
178
        $args = array_merge($args, $members);
179
180
        return $this->dispatch(Builder::build($command, $args));
181
    }
182
183
    /**
184
     * @override
@@ 187-194 (lines=8) @@
184
     * @override
185
     * @inheritDoc
186
     */
187
    public function zRemRangeByLex($key, $min, $max, array $options = [])
188
    {
189
        $command = Enum::ZREMRANGEBYLEX;
190
        $args = [$key, $min, $max];
191
        $args = array_merge($args, $options);
192
193
        return $this->dispatch(Builder::build($command, $args));
194
    }
195
196
    /**
197
     * @override
@@ 212-219 (lines=8) @@
209
     * @override
210
     * @inheritDoc
211
     */
212
    public function zRemRangeByScore($key, $min, $max, array $options = [])
213
    {
214
        $command = Enum::ZREMRANGEBYSCORE;
215
        $args = [$key, $min, $max];
216
        $args = array_merge($args, $options);
217
218
        return $this->dispatch(Builder::build($command, $args));
219
    }
220
221
    /**
222
     * @override
@@ 225-232 (lines=8) @@
222
     * @override
223
     * @inheritDoc
224
     */
225
    public function zRevRange($key, $start, $stop, array $options = [])
226
    {
227
        $command = Enum::ZREVRANGE;
228
        $args = [$key, $start, $stop];
229
        $args = array_merge($args, $options);
230
231
        return $this->dispatch(Builder::build($command, $args));
232
    }
233
234
    /**
235
     * @override
@@ 238-245 (lines=8) @@
235
     * @override
236
     * @inheritDoc
237
     */
238
    public function zRevRangeByScore($key, $max, $min, array $options = [])
239
    {
240
        $command = Enum::ZREVRANGEBYSCORE;
241
        $args = [$key,$max,$min];
242
        $args = array_merge($args, $options);
243
244
        return $this->dispatch(Builder::build($command, $args));
245
    }
246
247
    /**
248
     * @override
@@ 275-283 (lines=9) @@
272
     * @override
273
     * @inheritDoc
274
     */
275
    public function zScan($key, $cursor, array $options = [])
276
    {
277
        // TODO: Implement zScan() method.
278
        $command = Enum::ZSCAN;
279
        $args = [$key , $cursor];
280
        $args = array_merge($args, $options);
281
282
        return $this->dispatch(Builder::build($command, $args));
283
    }
284
285
    /**
286
     * @inheritDoc

src/Redis/Command/Compose/ApiSetTrait.php 8 locations

@@ 21-29 (lines=9) @@
18
     * @override
19
     * @inheritDoc
20
     */
21
    public function sScan($key, $cursor, array $options = [])
22
    {
23
        // TODO: Implement sScan() method.
24
        $command = Enum::SSCAN;
25
        $args = [$key, $cursor];
26
        $args = array_merge($args, $options);
27
28
        return $this->dispatch(Builder::build($command, $args));
29
    }
30
31
    /**
32
     * @override
@@ 48-56 (lines=9) @@
45
     * @override
46
     * @inheritDoc
47
     */
48
    public function sInterStore($dst, ...$keys)
49
    {
50
        // TODO: Implement sInterStore() method.
51
        $command = Enum::SINTERSTORE;
52
        $args = [$dst];
53
        $args = array_merge($args, $keys);
54
55
        return $this->dispatch(Builder::build($command, $args));
56
    }
57
58
    /**
59
     * @override
@@ 101-109 (lines=9) @@
98
     * @override
99
     * @inheritDoc
100
     */
101
    public function sMove($src, $dst, $members)
102
    {
103
        // TODO: Implement sMove() method.
104
        $command = Enum::SMOVE;
105
        $args = [$src, $dst];
106
        $args = array_merge( $args, $members);
107
108
        return $this->dispatch(Builder::build($command, $args));
109
    }
110
111
    /**
112
     * @override
@@ 141-149 (lines=9) @@
138
     * @override
139
     * @inheritDoc
140
     */
141
    public function sRem($key, ...$members)
142
    {
143
        // TODO: Implement sRem() method.
144
        $command = Enum::SREM;
145
        $args = [$key];
146
        $args = array_merge($args, $members);
147
148
        return $this->dispatch(Builder::build($command, $args));
149
    }
150
151
    /**
152
     * @override
@@ 168-176 (lines=9) @@
165
     * @override
166
     * @inheritDoc
167
     */
168
    public function sUnionStore($dst, ...$keys)
169
    {
170
        // TODO: Implement sUnionStore() method.
171
        $command = Enum::SUNIONSTORE;
172
        $args = [$dst];
173
        $args = array_merge($args, $keys);
174
175
        return $this->dispatch(Builder::build($command, $args));
176
    }
177
178
    /**
179
     * @override
@@ 182-190 (lines=9) @@
179
     * @override
180
     * @inheritDoc
181
     */
182
    public function sWapBb($opt, $dst, ...$keys)
183
    {
184
        // TODO: Implement sWapBb() method.
185
        $command = Enum::SWAPDB;
186
        $args = [$opt, $dst];
187
        $args = array_merge($args, $keys);
188
189
        return $this->dispatch(Builder::build($command, $args));
190
    }
191
192
    /**
193
     * @override
@@ 196-204 (lines=9) @@
193
     * @override
194
     * @inheritDoc
195
     */
196
    public function sAdd($key, ...$members)
197
    {
198
        // TODO: Implement sAdd() method.
199
        $command = Enum::SADD;
200
        $args = [$key];
201
        $args = array_merge($args, $members);
202
203
        return $this->dispatch(Builder::build($command, $args));
204
    }
205
206
    /**
207
     * @override
@@ 236-244 (lines=9) @@
233
     * @override
234
     * @inheritDoc
235
     */
236
    public function sDiffStore($dst, ...$keys)
237
    {
238
        // TODO: Implement sDiffStore() method.
239
        $command = Enum::SDIFFSTORE;
240
        $args = [$dst];
241
        $args = array_merge($args, $keys);
242
243
        return $this->dispatch(Builder::build($command, $args));
244
    }
245
}
246

src/Redis/Command/Compose/ApiTransactionTrait.php 1 location

@@ 57-65 (lines=9) @@
54
     * @override
55
     * @inheritDoc
56
     */
57
    public function watch($key, ...$keys)
58
    {
59
        // TODO: Implement watch() method.
60
        $command = Enum::WATCH;
61
        $args = [$key];
62
        $args = array_merge($args, $keys);
63
64
        return $this->dispatch(Builder::build($command, $args));
65
    }
66
}
67