Completed
Push — master ( 9e125a...9a1e57 )
by Kamil
02:25
created

ApiSetSortedTrait::zRevRank()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
ccs 0
cts 4
cp 0
rs 9.4285
nc 1
cc 1
eloc 4
nop 2
crap 2
1
<?php
2
3
namespace Dazzle\Redis\Command\Compose;
4
5
use Dazzle\Redis\Command\Builder;
6
use Dazzle\Redis\Command\Enum;
7
use Dazzle\Redis\Driver\Request;
8
9
trait ApiSetSortedTrait
10
{
11
    /**
12
     * @param Request $request
13
     * @return mixed
14
     */
15
    abstract function dispatch(Request $request);
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
17
    /**
18
     * @override
19
     * @inheritDoc
20
     */
21
    public function zAdd($key, array $options = [])
22
    {
23
        // TODO: Implement zAdd() method.
24
        $command = Enum::ZADD;
25
        $args = [$key];
26
        $args = array_merge($args, $options);
27
28
        return $this->dispatch(Builder::build($command, $args));
29
    }
30
31
    /**
32
     * @override
33
     * @inheritDoc
34
     */
35 View Code Duplication
    public function zCard($key)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
36
    {
37
        // TODO: Implement zCard() method.
38
        $command = Enum::ZCARD;
39
        $args = [$key];
40
41
        return $this->dispatch(Builder::build($command, $args));
42
    }
43
44
    /**
45
     * @override
46
     * @inheritDoc
47
     */
48 View Code Duplication
    public function zCount($key, $min, $max)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
49
    {
50
        // TODO: Implement zCount() method.
51
        $command = Enum::ZCOUNT;
52
        $args = [$key, $min, $max];
53
54
        return $this->dispatch(Builder::build($command, $args));
55
    }
56
57
    /**
58
     * @override
59
     * @inheritDoc
60
     */
61
    public function zIncrBy($key, $increment, $member)
62
    {
63
        // TODO: Implement zIncrBy() method.
64
        $command = Enum::ZINCRBY;
65
        $args = [$key, $increment, $member];
66
67
        return $this->dispatch(Builder::build($command, $args));
68
    }
69
70
    /**
71
     * @override
72
     * @inheritDoc
73
     */
74
    public function zInterStore($dst, $numKeys)
75
    {
76
        // TODO: Implement zInterStore() method.
77
        $command = Enum::ZINTERSTORE;
78
        $args = [$dst, $numKeys];
79
80
        return $this->dispatch(Builder::build($command, $args));
81
    }
82
83
    /**
84
     * @override
85
     * @inheritDoc
86
     */
87 View Code Duplication
    public function zLexCount($key, $min, $max)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
88
    {
89
        // TODO: Implement zLexCount() method.
90
        $command = Enum::ZLEXCOUNT;
91
        $args = [$key, $min, $max];
92
93
        return $this->dispatch(Builder::build($command, $args));
94
    }
95
96
    /**
97
     * @override
98
     * @inheritDoc
99
     */
100
    public function zRange($key, $star, $stop, array $options = [])
101
    {
102
        // TODO: Implement zRange() method.
103
        $command = Enum::ZRANGE;
104
        $args = [$key, $star,$stop];
105
        $args = array_merge($args, $options);
106
107
        return $this->dispatch(Builder::build($command, $args));
108
    }
109
110
    /**
111
     * @override
112
     * @inheritDoc
113
     */
114
    public function zRangeByLex($key, $min, $max, array $options = [])
115
    {
116
        // TODO: Implement zRangeByLex() method.
117
        $command = Enum::ZRANGEBYLEX;
118
        $args = [$key, $min, $max];
119
        $args = array_merge($args,$options);
120
121
        return $this->dispatch(Builder::build($command, $args));
122
    }
123
124
    /**
125
     * @override
126
     * @inheritDoc
127
     */
128
    public function zRevRangeByLex($key, $max, $min, array $options = [])
129
    {
130
        // TODO: Implement zRevRangeByLex() method.
131
        $command = Enum::ZREVRANGEBYLEX;
132
        $args = [$key, $max,$min];
133
        $args = array_merge($args,$options);
134
135
        return $this->dispatch(Builder::build($command, $args));
136
    }
137
138
    /**
139
     * @override
140
     * @inheritDoc
141
     */
142
    public function zRangeByScore($key, $min, $max, array $options = [])
143
    {
144
        // TODO: Implement zRangeByScore() method.
145
        $command = Enum::ZRANGEBYSCORE;
146
        $args = [$key, $min,$max];
147
        $args = array_merge($args, $options);
148
149
        return $this->dispatch(Builder::build($command, $args));
150
    }
151
152
    /**
153
     * @override
154
     * @inheritDoc
155
     */
156
    public function zRank($key, $member)
157
    {
158
        // TODO: Implement zRank() method.
159
        $command = Enum::ZRANK;
160
        $args = [$key,$member];
161
162
        return $this->dispatch(Builder::build($command, $args));
163
    }
164
165
    /**
166
     * @override
167
     * @inheritDoc
168
     */
169
    public function zRem($key, ...$members)
170
    {
171
        // TODO: Implement zRem() method.
172
        $command = Enum::ZREM;
173
        $args = [$key];
174
        $args = array_merge($args, $members);
175
176
        return $this->dispatch(Builder::build($command, $args));
177
    }
178
179
    /**
180
     * @override
181
     * @inheritDoc
182
     */
183 View Code Duplication
    public function zRemRangeByLex($key, $min, $max)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
184
    {
185
        // TODO: Implement zRemRangeByLex() method.
186
        $command = Enum::ZREMRANGEBYLEX;
187
        $args = [$key, $min, $max];
188
189
        return $this->dispatch(Builder::build($command, $args));
190
    }
191
192
    /**
193
     * @override
194
     * @inheritDoc
195
     */
196
    public function zRemRangeByRank($key, $start, $stop)
197
    {
198
        // TODO: Implement zRemRangeByRank() method.
199
        $command = Enum::ZREMRANGEBYRANK;
200
        $args = [$key, $start,$stop];
201
202
        return $this->dispatch(Builder::build($command, $args));
203
    }
204
205
    /**
206
     * @override
207
     * @inheritDoc
208
     */
209 View Code Duplication
    public function zRemRangeByScore($key, $min, $max)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
210
    {
211
        // TODO: Implement zRemRangeByScore() method.
212
        $command = Enum::ZREMRANGEBYSCORE;
213
        $args = [$key, $min, $max];
214
215
        return $this->dispatch(Builder::build($command, $args));
216
    }
217
218
    /**
219
     * @override
220
     * @inheritDoc
221
     */
222
    public function zRevRange($key, $start, $stop, array $options = [])
223
    {
224
        // TODO: Implement zRevRange() method.
225
        $command = Enum::ZREVRANGE;
226
        $args = [$key, $start, $stop];
227
        $args = array_merge($args, $options);
228
229
        return $this->dispatch(Builder::build($command, $args));
230
    }
231
232
    /**
233
     * @override
234
     * @inheritDoc
235
     */
236
    public function zRevRangeByScore($key, $max, $min, array $options = [])
237
    {
238
        // TODO: Implement zRevRangeByScore() method.
239
        $command = Enum::ZREVRANGEBYSCORE;
240
        $args = [$key,$max,$min];
241
        $args = array_merge($args, $options);
242
243
        return $this->dispatch(Builder::build($command, $args));
244
    }
245
246
    /**
247
     * @override
248
     * @inheritDoc
249
     */
250
    public function zRevRank($key, $member)
251
    {
252
        // TODO: Implement zRevRank() method.
253
        $command = Enum::ZREVRANK;
254
        $args = [$key,$member];
255
256
        return $this->dispatch(Builder::build($command, $args));
257
    }
258
259
    /**
260
     * @override
261
     * @inheritDoc
262
     */
263
    public function zScore($key, $member)
264
    {
265
        // TODO: Implement zScore() method.
266
        $command = Enum::ZSCORE;
267
        $args = [$key,$member];
268
269
        return $this->dispatch(Builder::build($command, $args));
270
    }
271
272
    /**
273
     * @override
274
     * @inheritDoc
275
     */
276
    public function zScan($key, $cursor, array $options = [])
277
    {
278
        // TODO: Implement zScan() method.
279
        $command = Enum::ZSCAN;
280
        $args = [$key , $cursor];
281
        $args = array_merge($args, $options);
282
283
        return $this->dispatch(Builder::build($command, $args));
284
    }
285
286
    /**
287
     * @inheritDoc
288
     */
289
    public function zUnionScore($dst, $numKeys)
290
    {
291
        // TODO: Implement zUnionScore() method.
292
        $command = Enum::ZUNIIONSCORE;
293
        $args = [$dst, $numKeys];
294
295
        return $this->dispatch(Builder::build($command, $args));
296
    }
297
}
298