@@ -29,14 +29,18 @@ interface CacheInterface
29
29
* requested key, that could be used e.g. for expiration control. It could also
30
30
* be an ItemInterface instance when its additional features are needed.
31
31
*
32
- * @param string $key The key of the item to retrieve from the cache
33
- * @param callable|CallbackInterface $callback Should return the computed value for the given key/item
34
- * @param float|null $beta A float that, as it grows, controls the likeliness of triggering
35
- * early expiration. 0 disables it, INF forces immediate expiration.
36
- * The default (or providing null) is implementation dependent but should
37
- * typically be 1.0, which should provide optimal stampede protection.
38
- * See https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration
39
- * @param array &$metadata The metadata of the cached item {@see ItemInterface::getMetadata()}
32
+ * @template T
33
+ *
34
+ * @param string $key The key of the item to retrieve from the cache
35
+ * @param (callable(CacheItemInterface,bool):T)|(callable(ItemInterface,bool):T)|CallbackInterface<T> $callback
36
+ * @param float|null $beta A float that, as it grows, controls the likeliness of triggering
37
+ * early expiration. 0 disables it, INF forces immediate expiration.
38
+ * The default (or providing null) is implementation dependent but should
39
+ * typically be 1.0, which should provide optimal stampede protection.
40
+ * See https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration
41
+ * @param array &$metadata The metadata of the cached item {@see ItemInterface::getMetadata()}
42
+ *
43
+ * @return T
40
44
*
41
45
* @throws InvalidArgumentException When $key is not valid or when $beta is negative
42
46
*/
0 commit comments