From 9e044478fb17bd9188628651dd9f197d3f09dd89 Mon Sep 17 00:00:00 2001 From: Emmanuel BORGES Date: Fri, 8 Mar 2019 13:51:22 +0100 Subject: [PATCH] remove function --- .../Validator/Mapping/Cache/Psr6Cache.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php b/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php index faae249b6ce65..e40617fe546f7 100644 --- a/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php +++ b/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php @@ -33,7 +33,7 @@ public function __construct(CacheItemPoolInterface $cacheItemPool) */ public function has($class) { - return $this->cacheItemPool->hasItem($this->escapeClassName($class)); + return $this->cacheItemPool->hasItem(rawurlencode($class)); } /** @@ -41,7 +41,7 @@ public function has($class) */ public function read($class) { - $item = $this->cacheItemPool->getItem($this->escapeClassName($class)); + $item = $this->cacheItemPool->getItem(rawurlencode($class)); if (!$item->isHit()) { return false; @@ -55,17 +55,9 @@ public function read($class) */ public function write(ClassMetadata $metadata) { - $item = $this->cacheItemPool->getItem($this->escapeClassName($metadata->getClassName())); + $item = $this->cacheItemPool->getItem(rawurlencode($metadata->getClassName())); $item->set($metadata); $this->cacheItemPool->save($item); } - - /** - * Replaces backslashes by dots in a class name. - */ - private function escapeClassName(string $class): string - { - return rawurlencode($class); - } }