Closed
Description
Symfony version(s) affected: 4.4+
Description
When creating a custom Lock Store that implements BlockingStoreInterface
creating the lock will throw an exception:
argument 1 passed to Symfony\Component\Lock\Factory::__construct() must be an instance of Symfony\Component\Lock\StoreInterface, instance of App\Lock\DatabaseStore given.
Because Symfony\Component\Lock\LockFactory
extends Symfony\Component\Lock\Factory
which is deprecated and has a deprecated construct param for Symfony\Component\Lock\StoreInterface
How to reproduce
- Create a custom Lock Store that implements
BlockingStoreInterface
- Create the lock using
Symfony\Component\Lock\LockFactory
you get an exception that you are not implementingSymfony\Component\Lock\StoreInterface
Possible Solution
Symfony\Component\Lock\LockFactory
shouldn't extend Symfony\Component\Lock\Factory
as this is deprecated.