@@ -15,7 +15,7 @@ interface CacheInterface
15
15
* @throws \Psr\SimpleCache\InvalidArgumentException
16
16
* MUST be thrown if the $key string is not a legal value.
17
17
*/
18
- public function get ($ key , $ default = null );
18
+ public function get (string $ key , mixed $ default = null );
19
19
20
20
/**
21
21
* Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
@@ -31,7 +31,7 @@ public function get($key, $default = null);
31
31
* @throws \Psr\SimpleCache\InvalidArgumentException
32
32
* MUST be thrown if the $key string is not a legal value.
33
33
*/
34
- public function set ($ key , $ value , $ ttl = null );
34
+ public function set (string $ key , mixed $ value , null | int | \ DateInterval $ ttl = null );
35
35
36
36
/**
37
37
* Delete an item from the cache by its unique key.
@@ -43,7 +43,7 @@ public function set($key, $value, $ttl = null);
43
43
* @throws \Psr\SimpleCache\InvalidArgumentException
44
44
* MUST be thrown if the $key string is not a legal value.
45
45
*/
46
- public function delete ($ key );
46
+ public function delete (string $ key );
47
47
48
48
/**
49
49
* Wipes clean the entire cache's keys.
@@ -64,7 +64,7 @@ public function clear();
64
64
* MUST be thrown if $keys is neither an array nor a Traversable,
65
65
* or if any of the $keys are not a legal value.
66
66
*/
67
- public function getMultiple ($ keys , $ default = null );
67
+ public function getMultiple (iterable $ keys , mixed $ default = null );
68
68
69
69
/**
70
70
* Persists a set of key => value pairs in the cache, with an optional TTL.
@@ -80,7 +80,7 @@ public function getMultiple($keys, $default = null);
80
80
* MUST be thrown if $values is neither an array nor a Traversable,
81
81
* or if any of the $values are not a legal value.
82
82
*/
83
- public function setMultiple ($ values , $ ttl = null );
83
+ public function setMultiple (iterable $ values , null | int | \ DateInterval $ ttl = null );
84
84
85
85
/**
86
86
* Deletes multiple cache items in a single operation.
@@ -93,7 +93,7 @@ public function setMultiple($values, $ttl = null);
93
93
* MUST be thrown if $keys is neither an array nor a Traversable,
94
94
* or if any of the $keys are not a legal value.
95
95
*/
96
- public function deleteMultiple ($ keys );
96
+ public function deleteMultiple (iterable $ keys );
97
97
98
98
/**
99
99
* Determines whether an item is present in the cache.
@@ -110,5 +110,5 @@ public function deleteMultiple($keys);
110
110
* @throws \Psr\SimpleCache\InvalidArgumentException
111
111
* MUST be thrown if the $key string is not a legal value.
112
112
*/
113
- public function has ($ key );
113
+ public function has (string $ key );
114
114
}
0 commit comments