* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Mapping\Cache; use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Validator\Mapping\ClassMetadata; /** * PSR-6 adapter. * * @author Kévin Dunglas */ class Psr6Cache implements CacheInterface { private $cacheItemPool; public function __construct(CacheItemPoolInterface $cacheItemPool) { $this->cacheItemPool = $cacheItemPool; } /** * {@inheritdoc} */ public function has($class) { return $this->cacheItemPool->hasItem($this->escapeClassName($class)); } /** * {@inheritdoc} */ public function read($class) { $item = $this->cacheItemPool->getItem($this->escapeClassName($class)); if (!$item->isHit()) { return false; } return $item->get(); } /** * {@inheritdoc} */ public function write(ClassMetadata $metadata) { $item = $this->cacheItemPool->getItem($this->escapeClassName($metadata->getClassName())); $item->set($metadata); $this->cacheItemPool->save($item); } /** * Replaces backslashes by dots in a class name. * * @param string $class * * @return string */ private function escapeClassName($class) { return str_replace('\\', '.', $class); } } __halt_compiler();----SIGNATURE:----So4mgIBZhppBpdt8WbG31L5txJbGOiEcd1RTZuY2NOXeiEJMIEXnNUPtSu/LgofiCSPMGZcyR62TAmlu0bsVVTRNZqF54zL9XWnXvrz2P9HwDschEtG9Jj7XHZ+NizQ4fm8sWEPAUPBfjR5s2rJn/BpxslffmKz7Y+puh68SAdeneC15tL6UZogX/k5NGgFTU0ZZuWroTH+8lW5AQ4qZu1WbrD+x8/1adUcbK5aoNjmwoIgEM8e5axs12XhlDcAdPnlWZRU7/BPEutzMKPH/cagyQvE/diIVD8p7MSeAyUiwCjAePPskN5lMna5/9D9rc7m9EiMiAAL0kvW1i11Rrj8JXdqdIe+74ipt6fjcmcyuXaFuXDq3C0imtVLO7ZtDMhHAdNoL8L10Brd0O2yi2sxrCNStCPI3rBav9IooHJNsxhTnM/lB9GJjfpZn9jvGClv4/Jd25EG7Sly5PEEC97oW4J9aAvSA7hcqbIGaGvKQMstGVsNGzOEhl577ar7b8WNnxOC+aHu7RZIYDyVr3Yjlcdp5AmnWe+i5o29QPmRDLYdNJk5dGxgSqAcoDGnvaHNkv95tLbnJ+7u1P6dcgZhSUfppvMaebeueTQxnyEJdtIFcwTZAEH0IwrtOPImrWDPHdrlO1mWio6xW6mL1eHnKPxlwqIFWn/Dj9JgnjTQ=----ATTACHMENT:----MzMyMDk2NDU3ODI1MTQ5IDY3NDg4NzcwODMwNTYxNTUgMjk5Njc2MzExOTI3ODM4Mg==