[Lock] Narrowed return type of LockFactory
makes mocks with NoLock
incompatible
#53713
Labels
LockFactory
makes mocks with NoLock
incompatible
#53713
Symfony version(s) affected
7.0+
Description
As part of #50852 the return types for both methods in
Symfony\Component\Lock\LockFactory
were narrowed from the baseLockInterface
to theSharedLockInterface
. In some test cases, we are mocking the lock factory and the mock provides aNoLock
instance to disable locks in the context of those tests. SinceNoLock
does not implementSharedLockInterface
, using it with theLockFactory
is no longer possible.How to reproduce
Possible Solution
One of:
LockFactory
methods to the baseLockInterface
SharedLockInterface
in theNoLock
classAdditional Context
No response
The text was updated successfully, but these errors were encountered: