diff --git a/composer.json b/composer.json index 2978fa5..da96ca8 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=5.3.0" + "php": ">=7.1.0" }, "autoload": { "psr-4": { diff --git a/src/CacheInterface.php b/src/CacheInterface.php index 99e8d95..39a079f 100644 --- a/src/CacheInterface.php +++ b/src/CacheInterface.php @@ -15,7 +15,7 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function get($key, $default = null); + public function get(string $key, $default = null); /** * 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); * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function set($key, $value, $ttl = null); + public function set(string $key, $value, $ttl = null): bool; /** * Delete an item from the cache by its unique key. @@ -43,14 +43,14 @@ public function set($key, $value, $ttl = null); * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function delete($key); + public function delete(string $key): bool; /** * Wipes clean the entire cache's keys. * * @return bool True on success and false on failure. */ - public function clear(); + public function clear(): bool; /** * Obtains multiple cache items by their unique keys. @@ -80,7 +80,7 @@ public function getMultiple($keys, $default = null); * MUST be thrown if $values is neither an array nor a Traversable, * or if any of the $values are not a legal value. */ - public function setMultiple($values, $ttl = null); + public function setMultiple($values, $ttl = null): bool; /** * Deletes multiple cache items in a single operation. @@ -93,7 +93,7 @@ public function setMultiple($values, $ttl = null); * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. */ - public function deleteMultiple($keys); + public function deleteMultiple($keys): bool; /** * Determines whether an item is present in the cache. @@ -110,5 +110,5 @@ public function deleteMultiple($keys); * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function has($key); + public function has(string $key): bool; }