Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cda4c6

Browse files
Emmanuel BORGESnicolas-grekas
Emmanuel BORGES
authored andcommitted
remove function
1 parent f4b9917 commit 2cda4c6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ public function write(ClassMetadata $metadata)
6161
$this->cacheItemPool->save($item);
6262
}
6363

64-
/**
65-
* Replaces backslashes by dots in a class name.
66-
*/
6764
private function escapeClassName(string $class): string
6865
{
69-
return rawurlencode($class);
66+
if (false !== strpos($class, '@')) {
67+
// anonymous class: replace all PSR6-reserved characters
68+
return str_replace(["\0", '\\', '/', '@', ':', '{', '}', '(', ')'], '.', $class);
69+
}
70+
71+
return str_replace('\\', '.', $class);
7072
}
7173
}

0 commit comments

Comments
 (0)