* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Doctrine\Common\Cache\Psr6; use Doctrine\Common\Cache\Cache; use Doctrine\Common\Cache\CacheProvider; use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Cache\Adapter\DoctrineAdapter as SymfonyDoctrineAdapter; use Symfony\Contracts\Service\ResetInterface; use function rawurlencode; /** * This class was copied from the Symfony Framework, see the original copyright * notice above. The code is distributed subject to the license terms in * https://github.com/symfony/symfony/blob/ff0cf61278982539c49e467db9ab13cbd342f76d/LICENSE */ final class DoctrineProvider extends CacheProvider { /** @var CacheItemPoolInterface */ private $pool; public static function wrap(CacheItemPoolInterface $pool): Cache { if ($pool instanceof CacheAdapter) { return $pool->getCache(); } if ($pool instanceof SymfonyDoctrineAdapter) { $getCache = function () { // phpcs:ignore Squiz.Scope.StaticThisUsage.Found return $this->provider; }; return $getCache->bindTo($pool, SymfonyDoctrineAdapter::class)(); } return new self($pool); } private function __construct(CacheItemPoolInterface $pool) { $this->pool = $pool; } /** @internal */ public function getPool(): CacheItemPoolInterface { return $this->pool; } public function reset(): void { if ($this->pool instanceof ResetInterface) { $this->pool->reset(); } $this->setNamespace($this->getNamespace()); } /** * {@inheritdoc} */ protected function doFetch($id) { $item = $this->pool->getItem(rawurlencode($id)); return $item->isHit() ? $item->get() : false; } /** * {@inheritdoc} * * @return bool */ protected function doContains($id) { return $this->pool->hasItem(rawurlencode($id)); } /** * {@inheritdoc} * * @return bool */ protected function doSave($id, $data, $lifeTime = 0) { $item = $this->pool->getItem(rawurlencode($id)); if (0 < $lifeTime) { $item->expiresAfter($lifeTime); } return $this->pool->save($item->set($data)); } /** * {@inheritdoc} * * @return bool */ protected function doDelete($id) { return $this->pool->deleteItem(rawurlencode($id)); } /** * {@inheritdoc} * * @return bool */ protected function doFlush() { return $this->pool->clear(); } /** * {@inheritdoc} * * @return array|null */ protected function doGetStats() { return null; } }__halt_compiler();----SIGNATURE:----Dux0DvzrkD6wb6pHYSTCA7LdH1CPG08l5IsGz9XVgm3oX+c7aCmWcZ4e0SJ436YmrzUHr34GWBTzs63zfOtGh3g8n9eMD1qTWTPcsp+arZMKcEKHK1buAFLVIpSlFVFScBC6yxGy5Z1QQrI+usl9kdj1EGyVoQDrYd6wSDVgW6i5S2c4rs/dfvMRQiT2DQ8i68UfmrbKmJ7NkBwU8/iUlAQxvqa/use/DpVPNKtgG1H0JP/tF1O93P9iC08Or8W94ZHQSSXwvigPTWbyg28L3JE5JTWGUFSIzeW+MkGgDrMIS0muBF6SV4kLYxaylsKJ3mJUk1mJrEnEq0lIcSua/+FWyAftV5G0NcQGcLYbMELarLIkx8W1vp/ZVAY+WT08fIV+VQBcVJU80x5nGK1EEo4OTQJYctmfLu29HNsnOn+PeJ8EfUFZGVOlwXl5qcFc6JyBImMtXl3PNP+oAU6RZFc/B2bt18RquQ5sgkBmBOMU0xeM37cLfa+qcT6222gbe0l9dvcSPo1Ec99BJcsdWlAileVwu0RG42hKSLjJHTOBgpYCa6MCPw4aKfV4G3l5kgbHpVcto8UYo8/ewSC5I/NxuuCpYf2NhOC1M6wHUsRgWfCD90XK3DalSUE+aK7MlLqaRFkhPQkt4EuPiPw37LtuGcqpMIWuqMUNQqIN/EE=----ATTACHMENT:----NDIxOTE3MzE5MTM3MDIyNCA2OTcxOTk3MzM5MTg2ODkzIDc0OTc5NTIxNjcwNDU2NTU=