comparison vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 1fec387a4317
children 129ea1e6d783
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
86 86
87 if (isset($this->loadedClasses[$class])) { 87 if (isset($this->loadedClasses[$class])) {
88 return $this->loadedClasses[$class]; 88 return $this->loadedClasses[$class];
89 } 89 }
90 90
91 if (!class_exists($class) && !interface_exists($class, false)) {
92 throw new NoSuchMetadataException(sprintf('The class or interface "%s" does not exist.', $class));
93 }
94
91 if (null !== $this->cache && false !== ($metadata = $this->cache->read($class))) { 95 if (null !== $this->cache && false !== ($metadata = $this->cache->read($class))) {
92 // Include constraints from the parent class 96 // Include constraints from the parent class
93 $this->mergeConstraints($metadata); 97 $this->mergeConstraints($metadata);
94 98
95 return $this->loadedClasses[$class] = $metadata; 99 return $this->loadedClasses[$class] = $metadata;
96 }
97
98 if (!class_exists($class) && !interface_exists($class)) {
99 throw new NoSuchMetadataException(sprintf('The class or interface "%s" does not exist.', $class));
100 } 100 }
101 101
102 $metadata = new ClassMetadata($class); 102 $metadata = new ClassMetadata($class);
103 103
104 if (null !== $this->loader) { 104 if (null !== $this->loader) {
158 return false; 158 return false;
159 } 159 }
160 160
161 $class = ltrim(is_object($value) ? get_class($value) : $value, '\\'); 161 $class = ltrim(is_object($value) ? get_class($value) : $value, '\\');
162 162
163 if (class_exists($class) || interface_exists($class)) { 163 return class_exists($class) || interface_exists($class, false);
164 return true;
165 }
166
167 return false;
168 } 164 }
169 } 165 }