update to PHP-8.1
[m6w6/seekat] / lib / API / Call / Cache / Service / Simple.php
index 4358f1f2f17f37233a6df9a612aa206e1f728227..45bd5fe0bc192d6aafbb457393ec7b4906f807cc 100644 (file)
@@ -7,13 +7,7 @@ use Psr\SimpleCache\CacheInterface;
 use seekat\API\Call\Cache\Service;
 
 final class Simple implements Service {
-       /**
-        * @var CacheInterface
-        */
-       private $cache;
-
-       public function __construct(CacheInterface $cache) {
-               $this->cache = $cache;
+       public function __construct(private readonly CacheInterface $cache) {
        }
 
        public function fetch(string $key, Response &$response = null) : bool {
@@ -25,11 +19,11 @@ final class Simple implements Service {
                return $this->cache->set($key, $response);
        }
 
-       public function del(string $key) {
+       public function del(string $key) : void {
                $this->cache->delete($key);
        }
 
-       public function clear() {
+       public function clear() : void {
                $this->cache->clear();
        }
 }