@@ -29,7 +29,7 @@ interface CacheItemPoolInterface
2929 * @return CacheItemInterface
3030 * The corresponding Cache Item.
3131 */
32- public function getItem (string $ key );
32+ public function getItem (string $ key ): CacheItemInterface ;
3333
3434 /**
3535 * Returns a traversable set of cache items.
@@ -41,13 +41,13 @@ public function getItem(string $key);
4141 * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException
4242 * MUST be thrown.
4343 *
44- * @return array|\Traversable
45- * A traversable collection of Cache Items keyed by the cache keys of
44+ * @return iterable
45+ * An iterable collection of Cache Items keyed by the cache keys of
4646 * each item. A Cache item will be returned for each key, even if that
4747 * key is not found. However, if no keys are specified then an empty
4848 * traversable MUST be returned instead.
4949 */
50- public function getItems (array $ keys = []);
50+ public function getItems (array $ keys = []): iterable ;
5151
5252 /**
5353 * Confirms if the cache contains specified cache item.
@@ -66,15 +66,15 @@ public function getItems(array $keys = []);
6666 * @return bool
6767 * True if item exists in the cache, false otherwise.
6868 */
69- public function hasItem (string $ key );
69+ public function hasItem (string $ key ): bool ;
7070
7171 /**
7272 * Deletes all items in the pool.
7373 *
7474 * @return bool
7575 * True if the pool was successfully cleared. False if there was an error.
7676 */
77- public function clear ();
77+ public function clear (): bool ;
7878
7979 /**
8080 * Removes the item from the pool.
@@ -89,7 +89,7 @@ public function clear();
8989 * @return bool
9090 * True if the item was successfully removed. False if there was an error.
9191 */
92- public function deleteItem (string $ key );
92+ public function deleteItem (string $ key ): bool ;
9393
9494 /**
9595 * Removes multiple items from the pool.
@@ -104,7 +104,7 @@ public function deleteItem(string $key);
104104 * @return bool
105105 * True if the items were successfully removed. False if there was an error.
106106 */
107- public function deleteItems (array $ keys );
107+ public function deleteItems (array $ keys ): bool ;
108108
109109 /**
110110 * Persists a cache item immediately.
@@ -115,7 +115,7 @@ public function deleteItems(array $keys);
115115 * @return bool
116116 * True if the item was successfully persisted. False if there was an error.
117117 */
118- public function save (CacheItemInterface $ item );
118+ public function save (CacheItemInterface $ item ): bool ;
119119
120120 /**
121121 * Sets a cache item to be persisted later.
@@ -126,13 +126,13 @@ public function save(CacheItemInterface $item);
126126 * @return bool
127127 * False if the item could not be queued or if a commit was attempted and failed. True otherwise.
128128 */
129- public function saveDeferred (CacheItemInterface $ item );
129+ public function saveDeferred (CacheItemInterface $ item ): bool ;
130130
131131 /**
132132 * Persists any deferred cache items.
133133 *
134134 * @return bool
135135 * True if all not-yet-saved items were successfully saved or there were none. False otherwise.
136136 */
137- public function commit ();
137+ public function commit (): bool ;
138138}
0 commit comments