rector/packages/Caching/Cache.php
Tomas Votruba 3313a231b7 Updated Rector to commit bb609b28e327ca1fb7827b6bc548013d19a2cf4e
bb609b28e3 [Core] Always reset stopTraversal to false on next Rector visit (#4182)
2023-06-11 14:17:34 +00:00

40 lines
960 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Caching;
use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
final class Cache
{
/**
* @var \Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface
*/
private $cacheStorage;
public function __construct(CacheStorageInterface $cacheStorage)
{
$this->cacheStorage = $cacheStorage;
}
/**
* @return mixed|null
*/
public function load(string $key, string $variableKey)
{
return $this->cacheStorage->load($key, $variableKey);
}
/**
* @param mixed $data
*/
public function save(string $key, string $variableKey, $data) : void
{
$this->cacheStorage->save($key, $variableKey, $data);
}
public function clear() : void
{
$this->cacheStorage->clear();
}
public function clean(string $cacheKey) : void
{
$this->cacheStorage->clean($cacheKey);
}
}