@@ -15,7 +15,7 @@ interface CacheInterface
1515 * @throws \Psr\SimpleCache\InvalidArgumentException
1616 * MUST be thrown if the $key string is not a legal value.
1717 */
18- public function get (string $ key , mixed $ default = null );
18+ public function get (string $ key , mixed $ default = null ): mixed ;
1919
2020 /**
2121 * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
@@ -31,7 +31,7 @@ public function get(string $key, mixed $default = null);
3131 * @throws \Psr\SimpleCache\InvalidArgumentException
3232 * MUST be thrown if the $key string is not a legal value.
3333 */
34- public function set (string $ key , mixed $ value , null |int |\DateInterval $ ttl = null );
34+ public function set (string $ key , mixed $ value , null |int |\DateInterval $ ttl = null ): bool ;
3535
3636 /**
3737 * Delete an item from the cache by its unique key.
@@ -43,14 +43,14 @@ public function set(string $key, mixed $value, null|int|\DateInterval $ttl = nul
4343 * @throws \Psr\SimpleCache\InvalidArgumentException
4444 * MUST be thrown if the $key string is not a legal value.
4545 */
46- public function delete (string $ key );
46+ public function delete (string $ key ): bool ;
4747
4848 /**
4949 * Wipes clean the entire cache's keys.
5050 *
5151 * @return bool True on success and false on failure.
5252 */
53- public function clear ();
53+ public function clear (): bool ;
5454
5555 /**
5656 * Obtains multiple cache items by their unique keys.
@@ -64,7 +64,7 @@ public function clear();
6464 * MUST be thrown if $keys is neither an array nor a Traversable,
6565 * or if any of the $keys are not a legal value.
6666 */
67- public function getMultiple (iterable $ keys , mixed $ default = null );
67+ public function getMultiple (iterable $ keys , mixed $ default = null ): iterable ;
6868
6969 /**
7070 * Persists a set of key => value pairs in the cache, with an optional TTL.
@@ -80,7 +80,7 @@ public function getMultiple(iterable $keys, mixed $default = null);
8080 * MUST be thrown if $values is neither an array nor a Traversable,
8181 * or if any of the $values are not a legal value.
8282 */
83- public function setMultiple (iterable $ values , null |int |\DateInterval $ ttl = null );
83+ public function setMultiple (iterable $ values , null |int |\DateInterval $ ttl = null ): bool ;
8484
8585 /**
8686 * Deletes multiple cache items in a single operation.
@@ -93,7 +93,7 @@ public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null
9393 * MUST be thrown if $keys is neither an array nor a Traversable,
9494 * or if any of the $keys are not a legal value.
9595 */
96- public function deleteMultiple (iterable $ keys );
96+ public function deleteMultiple (iterable $ keys ): bool ;
9797
9898 /**
9999 * Determines whether an item is present in the cache.
@@ -110,5 +110,5 @@ public function deleteMultiple(iterable $keys);
110110 * @throws \Psr\SimpleCache\InvalidArgumentException
111111 * MUST be thrown if the $key string is not a legal value.
112112 */
113- public function has (string $ key );
113+ public function has (string $ key ): bool ;
114114}
0 commit comments