--- ../src/Imdb/Cache.php +++ ../src/Imdb/Cache.php @@ -2,6 +2,7 @@ namespace Imdb; +use DateInterval; use Psr\Log\LoggerInterface; use Psr\SimpleCache\CacheInterface; @@ -53,7 +54,7 @@ /** * @inheritdoc */ - public function get($key, $default = null) + public function get(string $key, mixed $default = null): mixed { if (!$this->config->usecache) { return $default; @@ -90,7 +91,7 @@ /** * @inheritdoc */ - public function set($key, $value, $ttl = null) + public function set(string $key, mixed $value, null|int|DateInterval $ttl = null): bool { if (!$this->config->storecache) { return false; @@ -150,32 +151,32 @@ } // Some empty functions so we match the interface. These will never be used - public function getMultiple($keys, $default = null) + public function getMultiple(iterable $keys, mixed $default = null): iterable { return []; } - public function clear() + public function clear(): bool { return false; } - public function delete($key) + public function delete(string $key): bool { return false; } - public function deleteMultiple($keys) + public function deleteMultiple(iterable $keys): bool { return false; } - public function has($key) + public function has(string $key): bool { return false; } - public function setMultiple($values, $ttl = null) + public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool { return false; }