rector/packages/Caching/Cache.php
Tomas Votruba e29462ff33 Updated Rector to commit ac81e98fbfb138ffd1b3dd2725ee1c6b7010a22b
ac81e98fbf move from nette/caching to own cache based on PHPStan (#202)
2021-06-11 11:03:31 +00:00

40 lines
995 B
PHP

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