@@ -31,10 +31,7 @@ trait HashesCommandsTrait {
31
31
* not including specified but non existing fields.
32
32
*/
33
33
public function hdel ($ key , $ fields ) {
34
- return $ this ->returnCommand (['HDEL ' ], [
35
- Parameter::key ($ key ),
36
- Parameter::keys ($ fields ),
37
- ]);
34
+ return $ this ->returnCommand (['HDEL ' ], [$ key , (array ) $ fields ]);
38
35
}
39
36
40
37
/**
@@ -48,10 +45,7 @@ public function hdel($key, $fields) {
48
45
* @return int 1 if the hash contains field. 0 if the hash does not contain field, or key does not exist.
49
46
*/
50
47
public function hexists ($ key , $ field ) {
51
- return $ this ->returnCommand (['HEXISTS ' ], [
52
- Parameter::key ($ key ),
53
- Parameter::key ($ field ),
54
- ]);
48
+ return $ this ->returnCommand (['HEXISTS ' ], [$ key , $ field ]);
55
49
}
56
50
57
51
/**
@@ -66,10 +60,7 @@ public function hexists($key, $field) {
66
60
* or nil when field is not present in the hash or key does not exist.
67
61
*/
68
62
public function hget ($ key , $ field ) {
69
- return $ this ->returnCommand (['HGET ' ], [
70
- Parameter::key ($ key ),
71
- Parameter::key ($ field ),
72
- ]);
63
+ return $ this ->returnCommand (['HGET ' ], [$ key , $ field ]);
73
64
}
74
65
75
66
/**
@@ -83,7 +74,7 @@ public function hget($key, $field) {
83
74
* or an empty list when key does not exist.
84
75
*/
85
76
public function hgetall ($ key ) {
86
- return $ this ->returnCommand (['HGETALL ' ], [Parameter:: key ( $ key) ], ResponseParser::PARSE_ASSOC_ARRAY );
77
+ return $ this ->returnCommand (['HGETALL ' ], [$ key ], ResponseParser::PARSE_ASSOC_ARRAY );
87
78
}
88
79
89
80
/**
@@ -98,11 +89,7 @@ public function hgetall($key) {
98
89
* @return int The value at field after the increment operation.
99
90
*/
100
91
public function hincrby ($ key , $ field , $ increment ) {
101
- return $ this ->returnCommand (['HINCRBY ' ], [
102
- Parameter::key ($ key ),
103
- Parameter::key ($ field ),
104
- Parameter::integer ($ increment ),
105
- ]);
92
+ return $ this ->returnCommand (['HINCRBY ' ], [$ key , $ field , $ increment ]);
106
93
}
107
94
108
95
/**
@@ -117,11 +104,7 @@ public function hincrby($key, $field, $increment) {
117
104
* @return string The value of field after the increment.
118
105
*/
119
106
public function hincrbyfloat ($ key , $ field , $ increment ) {
120
- return $ this ->returnCommand (['HINCRBYFLOAT ' ], [
121
- Parameter::key ($ key ),
122
- Parameter::key ($ field ),
123
- Parameter::float ($ increment ),
124
- ]);
107
+ return $ this ->returnCommand (['HINCRBYFLOAT ' ], [$ key , $ field , $ increment ]);
125
108
}
126
109
127
110
/**
@@ -134,7 +117,7 @@ public function hincrbyfloat($key, $field, $increment) {
134
117
* @return string[] List of fields in the hash, or an empty list when key does not exist.
135
118
*/
136
119
public function hkeys ($ key ) {
137
- return $ this ->returnCommand (['HKEYS ' ], [Parameter:: key ( $ key) ]);
120
+ return $ this ->returnCommand (['HKEYS ' ], [$ key ]);
138
121
}
139
122
140
123
/**
@@ -147,7 +130,7 @@ public function hkeys($key) {
147
130
* @return int Number of fields in the hash, or 0 when key does not exist.
148
131
*/
149
132
public function hlen ($ key ) {
150
- return $ this ->returnCommand (['HLEN ' ], [Parameter:: key ( $ key) ]);
133
+ return $ this ->returnCommand (['HLEN ' ], [$ key ]);
151
134
}
152
135
153
136
/**
@@ -161,10 +144,7 @@ public function hlen($key) {
161
144
* @return array List of values associated with the given fields, in the same order as they are requested.
162
145
*/
163
146
public function hmget ($ key , $ fields ) {
164
- return $ this ->returnCommand (['HMGET ' ], [
165
- Parameter::key ($ key ),
166
- Parameter::keys ($ fields ),
167
- ]);
147
+ return $ this ->returnCommand (['HMGET ' ], [$ key , (array ) $ fields ]);
168
148
}
169
149
170
150
/**
@@ -176,10 +156,7 @@ public function hmget($key, $fields) {
176
156
* @return bool True
177
157
*/
178
158
public function hmset ($ key , array $ fieldValues ) {
179
- return $ this ->returnCommand (['HMSET ' ], [
180
- Parameter::key ($ key ),
181
- Parameter::assocArray ($ fieldValues ),
182
- ]);
159
+ return $ this ->returnCommand (['HMSET ' ], [$ key , Parameter::assocArray ($ fieldValues )]);
183
160
}
184
161
185
162
/**
@@ -195,11 +172,7 @@ public function hmset($key, array $fieldValues) {
195
172
* 0 if field already exists in the hash and the value was updated.
196
173
*/
197
174
public function hset ($ key , $ field , $ value ) {
198
- return $ this ->returnCommand (['HSET ' ], [
199
- Parameter::key ($ key ),
200
- Parameter::key ($ field ),
201
- Parameter::string ($ value ),
202
- ]);
175
+ return $ this ->returnCommand (['HSET ' ], [$ key , $ field , $ value ]);
203
176
}
204
177
205
178
/**
@@ -214,11 +187,7 @@ public function hset($key, $field, $value) {
214
187
* 0 if field already exists in the hash and no operation was performed.
215
188
*/
216
189
public function hsetnx ($ key , $ field , $ value ) {
217
- return $ this ->returnCommand (['HSETNX ' ], [
218
- Parameter::key ($ key ),
219
- Parameter::key ($ field ),
220
- Parameter::string ($ value ),
221
- ]);
190
+ return $ this ->returnCommand (['HSETNX ' ], [$ key , $ field , $ value ]);
222
191
}
223
192
224
193
/**
@@ -231,7 +200,7 @@ public function hsetnx($key, $field, $value) {
231
200
* @return string[] List of values in the hash, or an empty list when key does not exist.
232
201
*/
233
202
public function hvals ($ key ) {
234
- return $ this ->returnCommand (['HVALS ' ], [Parameter:: key ( $ key) ]);
203
+ return $ this ->returnCommand (['HVALS ' ], [$ key ]);
235
204
}
236
205
237
206
}
0 commit comments