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

Skip to content

[Lock] let BlockingStoreInterface extend PersistingStoreInterface #32803

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

Merged
merged 1 commit into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/BlockingStoreInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* @author Hamza Amrouche <[email protected]>
*/
interface BlockingStoreInterface
interface BlockingStoreInterface extends PersistingStoreInterface
{
/**
* Waits until a key becomes free, then stores the resource.
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/RetryTillSaveStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @author Jérémy Derussé <[email protected]>
*/
class RetryTillSaveStore implements PersistingStoreInterface, BlockingStoreInterface, StoreInterface, LoggerAwareInterface
class RetryTillSaveStore implements BlockingStoreInterface, StoreInterface, LoggerAwareInterface
{
use LoggerAwareTrait;

Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Lock/Tests/LockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function testAcquireReturnsFalseStoreInterface()
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
Expand Down Expand Up @@ -213,7 +213,7 @@ public function testReleaseStoreInterface()
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
Expand All @@ -232,7 +232,7 @@ public function testReleaseOnDestruction()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public function getStore()
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);
}
Expand Down