Skip to content

Commit

Permalink
remove function
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel BORGES authored and nicolas-grekas committed Mar 15, 2019
1 parent f4b9917 commit 2cda4c6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php
Expand Up @@ -61,11 +61,13 @@ public function write(ClassMetadata $metadata)
$this->cacheItemPool->save($item);
}

/**
* Replaces backslashes by dots in a class name.
*/
private function escapeClassName(string $class): string
{
return rawurlencode($class);
if (false !== strpos($class, '@')) {
// anonymous class: replace all PSR6-reserved characters
return str_replace(["\0", '\\', '/', '@', ':', '{', '}', '(', ')'], '.', $class);
}

return str_replace('\\', '.', $class);
}
}

0 comments on commit 2cda4c6

Please sign in to comment.