diff --git a/lib/Doctrine.php b/lib/Doctrine.php index c89ca04fb..a0d7350b7 100644 --- a/lib/Doctrine.php +++ b/lib/Doctrine.php @@ -527,9 +527,8 @@ final class Doctrine $modelFiles = array_keys(self::$_loadedModelFiles); foreach ($modelFiles as $name) { + $declaredBefore = get_declared_classes(); if (class_exists($name)) { - $declaredBefore = get_declared_classes(); - if (self::isValidModelClass($name) && !in_array($name, $loadedModels)) { $loadedModels[] = $name; }