Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e65178d

Browse files
Fix LockStoreSchemaListener not working properly with iterable objects
1 parent c87e4a1 commit e65178d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Symfony/Bridge/Doctrine/SchemaListener/LockStoreSchemaListener.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ public function postGenerateSchema(GenerateSchemaEventArgs $event): void
3030
{
3131
$connection = $event->getEntityManager()->getConnection();
3232

33-
$storesIterator = new \ArrayIterator($this->stores);
34-
while ($storesIterator->valid()) {
33+
foreach ($this->stores as $store) {
3534
try {
36-
$store = $storesIterator->current();
3735
if (!$store instanceof DoctrineDbalStore) {
3836
continue;
3937
}
@@ -42,8 +40,6 @@ public function postGenerateSchema(GenerateSchemaEventArgs $event): void
4240
} catch (InvalidArgumentException) {
4341
// no-op
4442
}
45-
46-
$storesIterator->next();
4743
}
4844
}
4945
}

0 commit comments

Comments
 (0)