for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Phact\Router;
use DateInterval;
use Psr\SimpleCache\CacheInterface;
trait CacheAwareTrait
{
/** @var CacheInterface */
protected $cache;
/** @var string */
protected $cacheKey = 'routes';
/** @var null|int|DateInterval */
protected $cacheTTL;
/**
* @inheritDoc
*/
public function setCache(CacheInterface $cache): void
$this->cache = $cache;
}
public function setCacheKey(string $key = 'routes'): void
$this->cacheKey = $key;
public function setCacheTTL($ttl = 60): void
$this->cacheTTL = $ttl;