update to PHP-8.1
[m6w6/seekat] / lib / API / Call / Cache / Service / ItemPool.php
index 264cfbd173ea4414eaeeb36324333ab38a0f3c29..fb488ad4006f3bfd470b6b12579c16a7602c04ce 100644 (file)
@@ -8,18 +8,9 @@ use Psr\Cache\CacheItemPoolInterface;
 use seekat\API\Call\Cache\Service;
 
 final class ItemPool implements Service {
-       /**
-        * @var CacheItemPoolInterface
-        */
-       private $cache;
-
-       /**
-        * @var CacheItemInterface
-        */
-       private $item;
+       private ?CacheItemInterface $item;
 
-       public function __construct(CacheItemPoolInterface $cache) {
-               $this->cache = $cache;
+       public function __construct(private readonly CacheItemPoolInterface $cache) {
        }
 
        /**
@@ -46,11 +37,11 @@ final class ItemPool implements Service {
         * @param string $key
         * @throws \Psr\Cache\InvalidArgumentException
         */
-       public function del(string $key) {
+       public function del(string $key) : void {
                $this->cache->deleteItem($key);
        }
 
-       public function clear() {
+       public function clear() : void {
                $this->cache->clear();
        }
 }