Skip to content

Commit

Permalink
remove function
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel BORGES committed Mar 8, 2019
1 parent f4b9917 commit 9e04447
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php
Expand Up @@ -33,15 +33,15 @@ public function __construct(CacheItemPoolInterface $cacheItemPool)
*/
public function has($class)
{
return $this->cacheItemPool->hasItem($this->escapeClassName($class));
return $this->cacheItemPool->hasItem(rawurlencode($class));
}

/**
* {@inheritdoc}
*/
public function read($class)
{
$item = $this->cacheItemPool->getItem($this->escapeClassName($class));
$item = $this->cacheItemPool->getItem(rawurlencode($class));

if (!$item->isHit()) {
return false;
Expand All @@ -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);
}
}

0 comments on commit 9e04447

Please sign in to comment.