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

Skip to content

Commit f881d28

Browse files
committed
[Validator] avoid to get information from the cache when we already have them locally (also fixes usage of this class when not using a cache)
1 parent 7c91ee5 commit f881d28

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public function getClassMetadata($class)
4545
{
4646
$class = ltrim($class, '\\');
4747

48+
if (isset($this->loadedClasses[$class])) {
49+
return $this->loadedClasses[$class];
50+
}
51+
4852
if (null !== $this->cache && false !== ($this->loadedClasses[$class] = $this->cache->read($class))) {
4953
return $this->loadedClasses[$class];
5054
}

0 commit comments

Comments
 (0)