-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Ignore invalid stores in LockStoreSchemaListener
raised by StoreFactory
#50761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DoctrineBridge] Ignore invalid stores in LockStoreSchemaListener
raised by StoreFactory
#50761
Conversation
…aised by `StoreFactory`
foreach ($this->stores as $store) { | ||
if (!$store instanceof DoctrineDbalStore) { | ||
continue; | ||
$storesIterator = new \ArrayIterator($this->stores); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be IteratorIterator ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum, no, because arrays
Thank you @alexandre-daubois. |
|
In our test environment, we're setting our
LOCK_DSN
env var atnull
. This works well in 6.2 but not in 6.3 anymore.The version 6.3 of DoctrineBridge is bringing this BC break. Indeed, lock stores are being injected in
Symfony\Bridge\Doctrine\SchemaListener\LockStoreSchemaListener
. At runtime, theStoreFactory
is used to instantiate stores when they are needed inpostGenerateSchema
.Unfortunately, our
LOCK_DSN=null
doesn't match any case inStoreFactory
, which has the effect to throwSymfony\Component\Lock\Exception\InvalidArgumentException
, which is not catched inLockStoreSchemaListener
.This PR takes care of this: at this time,
LockStoreSchemaListener
only deals withDoctrineDbalStore
. I think it is safe to ignore any instantiation problem that may occur in theStoreFactory
.