for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace KaLLoSz\Twig\Extension\Cache;
use Doctrine\Common\Cache\Cache;
use Doctrine\Common\Cache\ClearableCache;
/**
* Class DoctrineCacheBridge
*/
class DoctrineCacheBridge implements CacheInterface
{
* @var Cache
private $cache;
* @param Cache $cache
public function __construct(Cache $cache)
$this->cache = $cache;
}
* {@inheritdoc}
public function get($id)
return $this->has($id) ? $this->cache->fetch($id) : false;
public function has($id)
return $this->cache->contains($id);
public function save($id, $data, $lifeTime = 0)
return $this->cache->save($id, $data, $lifeTime);
public function delete($id)
return $this->cache->delete($id);
public function deleteAll()
if ($this->cache instanceof ClearableCache) {
return $this->cache->deleteAll();
return false;