rector/packages/Caching/Cache.php
Tomas Votruba c726969380 Updated Rector to commit fc10fce13dcf9767f54e4202b509020fed338645
fc10fce13d [Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
2021-12-04 12:47:17 +00:00

41 lines
1022 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Caching;
use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
final class Cache
{
/**
* @readonly
* @var \Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface
*/
private $cacheStorage;
public function __construct(\Rector\Caching\Contract\ValueObject\Storage\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);
}
}