Skip to content

Commit

Permalink
Avoid iterating on null for DoctrineBundle 2.2 and lower
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Oct 17, 2021
1 parent f76abb1 commit 53dec5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Doctrine/DoctrineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 53dec5c

Please sign in to comment.