From 53dec5c6281cb3c7de2eff5928785d6570821a64 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Wed, 13 Oct 2021 11:51:45 -0400 Subject: [PATCH] Avoid iterating on null for DoctrineBundle 2.2 and lower --- src/Doctrine/DoctrineHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);