@@ -31,10 +31,7 @@ trait HashesCommandsTrait {
3131 * not including specified but non existing fields.
3232 */
3333 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 ]);
3835 }
3936
4037 /**
@@ -48,10 +45,7 @@ public function hdel($key, $fields) {
4845 * @return int 1 if the hash contains field. 0 if the hash does not contain field, or key does not exist.
4946 */
5047 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 ]);
5549 }
5650
5751 /**
@@ -66,10 +60,7 @@ public function hexists($key, $field) {
6660 * or nil when field is not present in the hash or key does not exist.
6761 */
6862 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 ]);
7364 }
7465
7566 /**
@@ -83,7 +74,7 @@ public function hget($key, $field) {
8374 * or an empty list when key does not exist.
8475 */
8576 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 );
8778 }
8879
8980 /**
@@ -98,11 +89,7 @@ public function hgetall($key) {
9889 * @return int The value at field after the increment operation.
9990 */
10091 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 ]);
10693 }
10794
10895 /**
@@ -117,11 +104,7 @@ public function hincrby($key, $field, $increment) {
117104 * @return string The value of field after the increment.
118105 */
119106 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 ]);
125108 }
126109
127110 /**
@@ -134,7 +117,7 @@ public function hincrbyfloat($key, $field, $increment) {
134117 * @return string[] List of fields in the hash, or an empty list when key does not exist.
135118 */
136119 public function hkeys ($ key ) {
137- return $ this ->returnCommand (['HKEYS ' ], [Parameter:: key ( $ key) ]);
120+ return $ this ->returnCommand (['HKEYS ' ], [$ key ]);
138121 }
139122
140123 /**
@@ -147,7 +130,7 @@ public function hkeys($key) {
147130 * @return int Number of fields in the hash, or 0 when key does not exist.
148131 */
149132 public function hlen ($ key ) {
150- return $ this ->returnCommand (['HLEN ' ], [Parameter:: key ( $ key) ]);
133+ return $ this ->returnCommand (['HLEN ' ], [$ key ]);
151134 }
152135
153136 /**
@@ -161,10 +144,7 @@ public function hlen($key) {
161144 * @return array List of values associated with the given fields, in the same order as they are requested.
162145 */
163146 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 ]);
168148 }
169149
170150 /**
@@ -176,10 +156,7 @@ public function hmget($key, $fields) {
176156 * @return bool True
177157 */
178158 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 )]);
183160 }
184161
185162 /**
@@ -195,11 +172,7 @@ public function hmset($key, array $fieldValues) {
195172 * 0 if field already exists in the hash and the value was updated.
196173 */
197174 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 ]);
203176 }
204177
205178 /**
@@ -214,11 +187,7 @@ public function hset($key, $field, $value) {
214187 * 0 if field already exists in the hash and no operation was performed.
215188 */
216189 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 ]);
222191 }
223192
224193 /**
@@ -231,7 +200,7 @@ public function hsetnx($key, $field, $value) {
231200 * @return string[] List of values in the hash, or an empty list when key does not exist.
232201 */
233202 public function hvals ($ key ) {
234- return $ this ->returnCommand (['HVALS ' ], [Parameter:: key ( $ key) ]);
203+ return $ this ->returnCommand (['HVALS ' ], [$ key ]);
235204 }
236205
237206}
0 commit comments