bug #32803 [Lock] let BlockingStoreInterface extend PersistingStoreInterface (xabbuh)

This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] let BlockingStoreInterface extend PersistingStoreInterface

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/32555#issuecomment-515960229
| License       | MIT
| Doc PR        |

Commits
-------

eaad40e500 let BlockingStoreInterface extend PersistingStoreInterface
This commit is contained in:
Nicolas Grekas 2019-07-30 19:33:00 +02:00
commit 40fe1610d2
4 changed files with 7 additions and 7 deletions

View File

@ -16,7 +16,7 @@ use Symfony\Component\Lock\Exception\LockConflictedException;
/**
* @author Hamza Amrouche <hamza.simperfit@gmail.com>
*/
interface BlockingStoreInterface
interface BlockingStoreInterface extends PersistingStoreInterface
{
/**
* Waits until a key becomes free, then stores the resource.

View File

@ -26,7 +26,7 @@ use Symfony\Component\Lock\StoreInterface;
*
* @author Jérémy Derussé <jeremy@derusse.com>
*/
class RetryTillSaveStore implements PersistingStoreInterface, BlockingStoreInterface, StoreInterface, LoggerAwareInterface
class RetryTillSaveStore implements BlockingStoreInterface, StoreInterface, LoggerAwareInterface
{
use LoggerAwareTrait;

View File

@ -97,7 +97,7 @@ class LockTest extends TestCase
public function testAcquireBlocking()
{
$key = new Key(uniqid(__METHOD__, true));
$store = $this->getMockBuilder([PersistingStoreInterface::class, BlockingStoreInterface::class])->getMock();
$store = $this->createMock(BlockingStoreInterface::class);
$lock = new Lock($key, $store);
$store
@ -213,7 +213,7 @@ class LockTest extends TestCase
public function testReleaseOnDestruction()
{
$key = new Key(uniqid(__METHOD__, true));
$store = $this->getMockBuilder([PersistingStoreInterface::class, BlockingStoreInterface::class])->getMock();
$store = $this->createMock(BlockingStoreInterface::class);
$lock = new Lock($key, $store, 10);
$store
@ -232,7 +232,7 @@ class LockTest extends TestCase
public function testNoAutoReleaseWhenNotConfigured()
{
$key = new Key(uniqid(__METHOD__, true));
$store = $this->getMockBuilder([PersistingStoreInterface::class, BlockingStoreInterface::class])->getMock();
$store = $this->createMock(BlockingStoreInterface::class);
$lock = new Lock($key, $store, 10, false);
$store

View File

@ -62,8 +62,8 @@ class CombinedStoreTest extends AbstractStoreTest
protected function setUp()
{
$this->strategy = $this->getMockBuilder(StrategyInterface::class)->getMock();
$this->store1 = $this->getMockBuilder([PersistingStoreInterface::class, BlockingStoreInterface::class])->getMock();
$this->store2 = $this->getMockBuilder([PersistingStoreInterface::class, BlockingStoreInterface::class])->getMock();
$this->store1 = $this->createMock(BlockingStoreInterface::class);
$this->store2 = $this->createMock(BlockingStoreInterface::class);
$this->store = new CombinedStore([$this->store1, $this->store2], $this->strategy);
}