10000 Update src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php · symfony/symfony@99406eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 99406eb

Browse files
committed
Update src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php
1 parent 91e977d commit 99406eb

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

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

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

48-
if (!isset($this->loadedClasses[$class])) {
49-
if ($this->cache !== null && $this->cache->has($class)) {
50-
$this->loadedClasses[$class] = $this->cache->read($class);
51-
} else {
52-
$metadata = new ClassMetadata($class);
53-
54-
// Include constraints from the parent class
55-
if ($parent = $metadata->getReflectionClass()->getParentClass()) {
56-
$metadata->mergeConstraints($this->getClassMetadata($parent->getName()));
57-
}
58-
59-
// Include constraints from all implemented interfaces
60-
foreach ($metadata->getReflectionClass()->getInterfaces() as $interface) {
61-
if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->getName()) {
62-
continue;
63-
}
64-
$metadata->mergeConstraints($this->getClassMetadata($interface->getName()));
65-
}
66-
67-
$this->loader->loadClassMetadata($metadata);
68-
69-
$this->loadedClasses[$class] = $metadata;
70-
71-
if ($this->cache !== null) {
72-
$this->cache->write($metadata);
73-
}
74-
}
75-
}
76-
7748
if (null !== $this->cache && false !== ($this->loadedClasses[$class] = $this->cache->read($class))) {
7849
return $this->loadedClasses[$class];
7950
}
@@ -87,6 +58,9 @@ public function getClassMetadata($class)
8758

8859
// Include constraints from all implemented interfaces
8960
foreach ($metadata->getReflectionClass()->getInterfaces() as $interface) {
61+
if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->getName()) {
62+
continue;
63+
}
9064
$metadata->mergeConstraints($this->getClassMetadata($interface->getName()));
9165
}
9266

0 commit comments

Comments
 (0)
0