← All changes
|
includes/sdk/google/psr/cache/src/CacheItemPoolInterface.php
+13
-12
1.2.2
→
1.4.1
View file →
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -namespace Dudlewebs\WPMCS\Psr\Cache; | |
| 3 | +namespace Dudlewebs\WPMCS\GCP\Psr\Cache; | |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * CacheItemPoolInterface generates CacheItemInterface objects. |
| 7 | 7 | * |
| @@ -28,9 +28,9 @@ | ||
| 28 | 28 | * |
| 29 | 29 | * @return CacheItemInterface |
| 30 | 30 | * The corresponding Cache Item. |
| 31 | 31 | */ |
| 32 | - public function getItem($key); | |
| 32 | + public function getItem(string $key) : CacheItemInterface; | |
| 33 | 33 | /** |
| 34 | 34 | * Returns a traversable set of cache items. |
| 35 | 35 | * |
| 36 | 36 | * @param string[] $keys |
| @@ -39,15 +39,15 @@ | ||
| 39 | 39 | * @throws InvalidArgumentException |
| 40 | 40 | * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException |
| 41 | 41 | * MUST be thrown. |
| 42 | 42 | * |
| 43 | - * @return array|\Traversable | |
| 44 | - * A traversable collection of Cache Items keyed by the cache keys of | |
| 43 | + * @return iterable | |
| 44 | + * An iterable collection of Cache Items keyed by the cache keys of | |
| 45 | 45 | * each item. A Cache item will be returned for each key, even if that |
| 46 | 46 | * key is not found. However, if no keys are specified then an empty |
| 47 | 47 | * traversable MUST be returned instead. |
| 48 | 48 | */ |
| 49 | - public function getItems(array $keys = array()); | |
| 49 | + public function getItems(array $keys = []) : iterable; | |
| 50 | 50 | /** |
| 51 | 51 | * Confirms if the cache contains specified cache item. |
| 52 | 52 | * |
| 53 | 53 | * Note: This method MAY avoid retrieving the cached value for performance reasons. |
| @@ -63,9 +63,9 @@ | ||
| 63 | 63 | * |
| 64 | 64 | * @return bool |
| 65 | 65 | * True if item exists in the cache, false otherwise. |
| 66 | 66 | */ |
| 67 | - public function hasItem($key); | |
| 67 | + public function hasItem(string $key) : bool; | |
| 68 | 68 | /** |
| 69 | 69 | * Deletes all items in the pool. |
| 70 | 70 | * |
| 71 | 71 | * @return bool |
| @@ -70,9 +70,9 @@ | ||
| 70 | 70 | * |
| 71 | 71 | * @return bool |
| 72 | 72 | * True if the pool was successfully cleared. False if there was an error. |
| 73 | 73 | */ |
| 74 | - public function clear(); | |
| 74 | + public function clear() : bool; | |
| 75 | 75 | /** |
| 76 | 76 | * Removes the item from the pool. |
| 77 | 77 | * |
| 78 | 78 | * @param string $key |
| @@ -84,14 +84,15 @@ | ||
| 84 | 84 | * |
| 85 | 85 | * @return bool |
| 86 | 86 | * True if the item was successfully removed. False if there was an error. |
| 87 | 87 | */ |
| 88 | - public function deleteItem($key); | |
| 88 | + public function deleteItem(string $key) : bool; | |
| 89 | 89 | /** |
| 90 | 90 | * Removes multiple items from the pool. |
| 91 | 91 | * |
| 92 | 92 | * @param string[] $keys |
| 93 | 93 | * An array of keys that should be removed from the pool. |
| 94 | + * | |
| 94 | 95 | * @throws InvalidArgumentException |
| 95 | 96 | * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException |
| 96 | 97 | * MUST be thrown. |
| 97 | 98 | * |
| @@ -97,9 +98,9 @@ | ||
| 97 | 98 | * |
| 98 | 99 | * @return bool |
| 99 | 100 | * True if the items were successfully removed. False if there was an error. |
| 100 | 101 | */ |
| 101 | - public function deleteItems(array $keys); | |
| 102 | + public function deleteItems(array $keys) : bool; | |
| 102 | 103 | /** |
| 103 | 104 | * Persists a cache item immediately. |
| 104 | 105 | * |
| 105 | 106 | * @param CacheItemInterface $item |
| @@ -107,9 +108,9 @@ | ||
| 107 | 108 | * |
| 108 | 109 | * @return bool |
| 109 | 110 | * True if the item was successfully persisted. False if there was an error. |
| 110 | 111 | */ |
| 111 | - public function save(CacheItemInterface $item); | |
| 112 | + public function save(CacheItemInterface $item) : bool; | |
| 112 | 113 | /** |
| 113 | 114 | * Sets a cache item to be persisted later. |
| 114 | 115 | * |
| 115 | 116 | * @param CacheItemInterface $item |
| @@ -117,9 +118,9 @@ | ||
| 117 | 118 | * |
| 118 | 119 | * @return bool |
| 119 | 120 | * False if the item could not be queued or if a commit was attempted and failed. True otherwise. |
| 120 | 121 | */ |
| 121 | - public function saveDeferred(CacheItemInterface $item); | |
| 122 | + public function saveDeferred(CacheItemInterface $item) : bool; | |
| 122 | 123 | /** |
| 123 | 124 | * Persists any deferred cache items. |
| 124 | 125 | * |
| 125 | 126 | * @return bool |
| @@ -124,6 +125,6 @@ | ||
| 124 | 125 | * |
| 125 | 126 | * @return bool |
| 126 | 127 | * True if all not-yet-saved items were successfully saved or there were none. False otherwise. |
| 127 | 128 | */ |
| 128 | - public function commit(); | |
| 129 | + public function commit() : bool; | |
| 129 | 130 | } |