diff --git a/src/Doctrine/DoctrineHelper.php b/src/Doctrine/DoctrineHelper.php index 12b58d309..961d42981 100644 --- a/src/Doctrine/DoctrineHelper.php +++ b/src/Doctrine/DoctrineHelper.php @@ -311,7 +311,7 @@ private function getMappingDriverForNamespace(string $namespace): ?MappingDriver $lowestCharacterDiff = null; $foundDriver = null; - foreach ($this->mappingDriversByPrefix as $key => $mappings) { + foreach ($this->mappingDriversByPrefix ?? [] as $mappings) { foreach ($mappings as [$prefix, $driver]) { $diff = substr_compare($namespace, $prefix, 0);