diff 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
line wrap: on
line diff
--- a/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php	Thu Apr 26 11:26:54 2018 +0100
+++ b/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php	Tue Jul 10 15:07:59 2018 +0100
@@ -88,6 +88,10 @@
             return $this->loadedClasses[$class];
         }
 
+        if (!class_exists($class) && !interface_exists($class, false)) {
+            throw new NoSuchMetadataException(sprintf('The class or interface "%s" does not exist.', $class));
+        }
+
         if (null !== $this->cache && false !== ($metadata = $this->cache->read($class))) {
             // Include constraints from the parent class
             $this->mergeConstraints($metadata);
@@ -95,10 +99,6 @@
             return $this->loadedClasses[$class] = $metadata;
         }
 
-        if (!class_exists($class) && !interface_exists($class)) {
-            throw new NoSuchMetadataException(sprintf('The class or interface "%s" does not exist.', $class));
-        }
-
         $metadata = new ClassMetadata($class);
 
         if (null !== $this->loader) {
@@ -160,10 +160,6 @@
 
         $class = ltrim(is_object($value) ? get_class($value) : $value, '\\');
 
-        if (class_exists($class) || interface_exists($class)) {
-            return true;
-        }
-
-        return false;
+        return class_exists($class) || interface_exists($class, false);
     }
 }