[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)
This commit is contained in:
parent
7c91ee5755
commit
f881d28240
@ -45,6 +45,10 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface
|
|||||||
{
|
{
|
||||||
$class = ltrim($class, '\\');
|
$class = ltrim($class, '\\');
|
||||||
|
|
||||||
|
if (isset($this->loadedClasses[$class])) {
|
||||||
|
return $this->loadedClasses[$class];
|
||||||
|
}
|
||||||
|
|
||||||
if (null !== $this->cache && false !== ($this->loadedClasses[$class] = $this->cache->read($class))) {
|
if (null !== $this->cache && false !== ($this->loadedClasses[$class] = $this->cache->read($class))) {
|
||||||
return $this->loadedClasses[$class];
|
return $this->loadedClasses[$class];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user