@@ -123,7 +123,7 @@ public function get(array|UnitEnum|string $key, mixed $default = null): mixed
123123 return $ this ->many ($ key );
124124 }
125125
126- $ key = ( string ) enum_value ($ key );
126+ $ key = enum_value ($ key );
127127
128128 $ this ->event (new RetrievingKey ($ this ->getName (), $ key ));
129129
@@ -198,7 +198,7 @@ public function put(array|UnitEnum|string $key, mixed $value, DateInterval|DateT
198198 return $ this ->putMany ($ key , $ value );
199199 }
200200
201- $ key = ( string ) enum_value ($ key );
201+ $ key = enum_value ($ key );
202202
203203 if ($ ttl === null ) {
204204 return $ this ->forever ($ key , $ value );
@@ -270,7 +270,7 @@ public function setMultiple(iterable $values, DateInterval|DateTimeInterface|int
270270 */
271271 public function add (UnitEnum |string $ key , mixed $ value , DateInterval |DateTimeInterface |int |null $ ttl = null ): bool
272272 {
273- $ key = ( string ) enum_value ($ key );
273+ $ key = enum_value ($ key );
274274
275275 $ seconds = null ;
276276
@@ -308,23 +308,23 @@ public function add(UnitEnum|string $key, mixed $value, DateInterval|DateTimeInt
308308 */
309309 public function increment (UnitEnum |string $ key , int $ value = 1 ): bool |int
310310 {
311- return $ this ->store ->increment (( string ) enum_value ($ key ), $ value );
311+ return $ this ->store ->increment (enum_value ($ key ), $ value );
312312 }
313313
314314 /**
315315 * Decrement the value of an item in the cache.
316316 */
317317 public function decrement (UnitEnum |string $ key , int $ value = 1 ): bool |int
318318 {
319- return $ this ->store ->decrement (( string ) enum_value ($ key ), $ value );
319+ return $ this ->store ->decrement (enum_value ($ key ), $ value );
320320 }
321321
322322 /**
323323 * Store an item in the cache indefinitely.
324324 */
325325 public function forever (UnitEnum |string $ key , mixed $ value ): bool
326326 {
327- $ key = ( string ) enum_value ($ key );
327+ $ key = enum_value ($ key );
328328
329329 $ this ->event (new WritingKey ($ this ->getName (), $ key , $ value ));
330330
@@ -408,7 +408,7 @@ public function rememberForever(UnitEnum|string $key, Closure $callback): mixed
408408 */
409409 public function forget (UnitEnum |string $ key ): bool
410410 {
411- $ key = ( string ) enum_value ($ key );
411+ $ key = enum_value ($ key );
412412
413413 $ this ->event (new ForgettingKey ($ this ->getName (), $ key ));
414414
0 commit comments