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) {
}
/**
* @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();
}
}