1 | <?php |
||
7 | trait SortedSets |
||
8 | { |
||
9 | /* |
||
10 | * Available Set Operations |
||
11 | */ |
||
12 | protected $SET_OPERATIONS = ['SUM', 'MIN', 'MAX']; |
||
13 | |||
14 | public function bzPop(): bool |
||
18 | |||
19 | /** |
||
20 | * Add one or more members to a sorted set or update its score if it |
||
21 | * already exists. |
||
22 | * See: https://redis.io/commands/zadd. |
||
23 | * |
||
24 | * @param string $key |
||
25 | * @param float $score |
||
26 | * @param mixed] $member |
||
|
|||
27 | * |
||
28 | * @return int 1 if the element is added. 0 otherwise. |
||
29 | */ |
||
30 | public function zAdd(string $key, float $score, $member): int |
||
34 | |||
35 | /** |
||
36 | * Get the number of members in a sorted set. |
||
37 | * See: https://redis.io/commands/zcard. |
||
38 | * |
||
39 | * @param string $key |
||
40 | * |
||
41 | * @return int The Set's cardinality |
||
42 | */ |
||
43 | public function zCard(string $key): int |
||
47 | |||
48 | /** |
||
49 | * Get the number of members in a sorted set. |
||
50 | * Note: zSize is an alias for zCard and will be removed in future |
||
51 | * versions of phpredis. |
||
52 | * See: https://redis.io/commands/zcard. |
||
53 | * |
||
54 | * @param string $key |
||
55 | * |
||
56 | * @return int The Set's cardinality |
||
57 | */ |
||
58 | public function zSize(string $key): int |
||
62 | |||
63 | /** |
||
64 | * Returns the number of elements of the sorted set stored at the specified |
||
65 | * key which have scores in the range [start, end]. Adding a parenthesis |
||
66 | * before start or end excludes it from the range. +inf and -inf are also |
||
67 | * valid limits. |
||
68 | * See: https://redis.io/commands/zcount. |
||
69 | * |
||
70 | * @param string $key |
||
71 | * @param mixed|int|string $start |
||
72 | * @param mixed|int|string $end |
||
73 | * |
||
74 | * @return int the size of a corresponding zRangeByScore. |
||
75 | */ |
||
76 | public function zCount(string $key, $start, $end): int |
||
80 | |||
81 | /** |
||
82 | * Increments the score of a member from a sorted set by a given amount. |
||
83 | * See: https://redis.io/commands/zincrby. |
||
84 | * |
||
85 | * @param string $key |
||
86 | * @param float $value (double) value that will be added to the |
||
87 | * member's score). |
||
88 | * @param string $member |
||
89 | * |
||
90 | * @return float the new value |
||
91 | */ |
||
92 | public function zIncrBy(string $key, float $value, $member): float |
||
96 | |||
97 | /** |
||
98 | * Creates an intersection of sorted sets given in second argument. |
||
99 | * The result of the union will be stored in the sorted set defined by the |
||
100 | * first argument. |
||
101 | * The third optional argument defines weights to apply to the sorted sets |
||
102 | * in input. In this case, the weights will be multiplied by the score of |
||
103 | * each element in the sorted set before applying the aggregation. The |
||
104 | * forth argument defines the AGGREGATE option which specify how the |
||
105 | * results of the union are aggregated. |
||
106 | * See: https://redis.io/commands/zinterstore. |
||
107 | * |
||
108 | * @param string $keyOutput |
||
109 | * @param array $arrayZSetKeys |
||
110 | * @param array $arrayWeights |
||
111 | * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": |
||
112 | * defines the behaviour to use on |
||
113 | * duplicate entries during the |
||
114 | * zInterStore. |
||
115 | * |
||
116 | * @return int The number of values in the new |
||
117 | * sorted set. |
||
118 | */ |
||
119 | public function zInterStore( |
||
144 | |||
145 | /** |
||
146 | * Creates an intersection of sorted sets given in second argument. |
||
147 | * The result of the union will be stored in the sorted set defined by the |
||
148 | * first argument. |
||
149 | * The third optional argument defines weights to apply to the sorted sets |
||
150 | * in input. In this case, the weights will be multiplied by the score of |
||
151 | * each element in the sorted set before applying the aggregation. The |
||
152 | * forth argument defines the AGGREGATE option which specify how the |
||
153 | * results of the union are aggregated. |
||
154 | * Note: zInter is an alias for zinterstore and will be removed in future |
||
155 | * versions of phpredis. |
||
156 | * See: https://redis.io/commands/zinterstore. |
||
157 | * |
||
158 | * @param string $keyOutput |
||
159 | * @param array $arrayZSetKeys |
||
160 | * @param array $arrayWeights |
||
161 | * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": |
||
162 | * defines the behaviour to use on |
||
163 | * duplicate entries during the |
||
164 | * zInterStore. |
||
165 | * |
||
166 | * @return int The number of values in the new |
||
167 | * sorted set. |
||
168 | */ |
||
169 | public function zInter( |
||
194 | |||
195 | public function zPop(): bool |
||
199 | |||
200 | public function zRange(): bool |
||
204 | |||
205 | public function zRangeByScore(): bool |
||
209 | |||
210 | public function zRevRangeByScore(): bool |
||
214 | |||
215 | public function zRangeByLex(): bool |
||
219 | |||
220 | public function zRank(): bool |
||
224 | |||
225 | public function zRevRank(): bool |
||
229 | |||
230 | public function zRem(): bool |
||
234 | |||
235 | public function zDelete(): bool |
||
239 | |||
240 | public function zRemove(): bool |
||
244 | |||
245 | public function zRemRangeByRank(): bool |
||
249 | |||
250 | public function zDeleteRangeByRank(): bool |
||
254 | |||
255 | public function zRemRangeByScore(): bool |
||
259 | |||
260 | public function zDeleteRangeByScore(): bool |
||
264 | |||
265 | public function zRemoveRangeByScore(): bool |
||
269 | |||
270 | public function zRevRange(): bool |
||
274 | |||
275 | public function zScore(): bool |
||
279 | |||
280 | public function zunionstore(): bool |
||
284 | |||
285 | public function zUnion(): bool |
||
289 | |||
290 | public function zScan(): bool |
||
294 | } |
||
295 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.