for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
*
* This file is part of phpFastCache.
* @license MIT License (MIT)
* For full copyright and license information, please see the docs/CREDITS.txt file.
* @author Georges.L (Geolim4) <[email protected]>
* @author PastisD https://github.com/PastisD
* @author Alexander (asm89) <[email protected]>
* @author Khoa Bui (khoaofgod) <[email protected]> http://www.phpfastcache.com
*/
declare(strict_types=1);
namespace Phpfastcache\Bundle\Twig\CacheExtension;
* Extension for caching template blocks with twig.
* @author Alexander <[email protected]>
class Extension extends \Twig_Extension
{
private $cacheStrategy;
* @param CacheStrategyInterface $cacheStrategy
public function __construct(CacheStrategyInterface $cacheStrategy)
$this->cacheStrategy = $cacheStrategy;
}
* @return CacheStrategyInterface
public function getCacheStrategy()
return $this->cacheStrategy;
* {@inheritDoc}
public function getName()
if (\version_compare(\Twig_Environment::VERSION, '1.26.0', '>=')) {
return \get_class($this);
return 'phpfastcache_cache';
public function getTokenParsers()
return [
new TokenParser\Cache(),
];