Skip to content

Commit 95f42cf

Browse files
committed
[Lock] remove uusage of the StoreInterface
1 parent 52e9fb9 commit 95f42cf

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
16001600
$container->setDefinition($connectionDefinitionId, $connectionDefinition);
16011601
}
16021602

1603-
$storeDefinition = new Definition(StoreInterface::class);
1603+
$storeDefinition = new Definition(PersistStoreInterface::class);
16041604
$storeDefinition->setPublic(false);
16051605
$storeDefinition->setFactory([StoreFactory::class, 'createStore']);
16061606
$storeDefinition->setArguments([new Reference($connectionDefinitionId)]);

src/Symfony/Component/Lock/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Factory implements LoggerAwareInterface
2828

2929
private $store;
3030

31-
public function __construct(StoreInterface $store)
31+
public function __construct(PersistStoreInterface $store)
3232
{
3333
$this->store = $store;
3434

src/Symfony/Component/Lock/Tests/FactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Psr\Log\LoggerInterface;
1616
use Symfony\Component\Lock\Factory;
1717
use Symfony\Component\Lock\LockInterface;
18-
use Symfony\Component\Lock\StoreInterface;
18+
use Symfony\Component\Lock\PersistStoreInterface;
1919

2020
/**
2121
* @author Jérémy Derussé <jeremy@derusse.com>
@@ -24,7 +24,7 @@ class FactoryTest extends TestCase
2424
{
2525
public function testCreateLock()
2626
{
27-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
27+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
2828
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
2929
$factory = new Factory($store);
3030
$factory->setLogger($logger);

src/Symfony/Component/Lock/Tests/LockFactoryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Psr\Log\LoggerInterface;
1616
use Symfony\Component\Lock\LockFactory;
1717
use Symfony\Component\Lock\LockInterface;
18+
use Symfony\Component\Lock\PersistStoreInterface;
1819
use Symfony\Component\Lock\StoreInterface;
1920

2021
/**
@@ -24,7 +25,7 @@ class LockFactoryTest extends TestCase
2425
{
2526
public function testCreateLock()
2627
{
27-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
28+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
2829
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
2930
$factory = new LockFactory($store);
3031
$factory->setLogger($logger);

src/Symfony/Component/Lock/Tests/LockTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testAcquireNoBlocking()
4141
public function testAcquireNoBlockingStoreInterface()
4242
{
4343
$key = new Key(uniqid(__METHOD__, true));
44-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
44+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
4545
$lock = new Lock($key, $store);
4646

4747
$store
@@ -59,7 +59,7 @@ public function testAcquireNoBlockingStoreInterface()
5959
public function testPassingOldStoreInterface()
6060
{
6161
$key = new Key(uniqid(__METHOD__, true));
62-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
62+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
6363
$lock = new Lock($key, $store);
6464

6565
$store
@@ -86,7 +86,7 @@ public function testAcquireReturnsFalse()
8686
public function testAcquireReturnsFalseStoreInterface()
8787
{
8888
$key = new Key(uniqid(__METHOD__, true));
89-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
89+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
9090
$lock = new Lock($key, $store);
9191

9292
$store
@@ -121,7 +121,7 @@ public function testAcquireBlocking()
121121
public function testAcquireSetsTtl()
122122
{
123123
$key = new Key(uniqid(__METHOD__, true));
124-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
124+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
125125
$lock = new Lock($key, $store, 10);
126126

127127
$store
@@ -138,7 +138,7 @@ public function testAcquireSetsTtl()
138138
public function testRefresh()
139139
{
140140
$key = new Key(uniqid(__METHOD__, true));
141-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
141+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
142142
$lock = new Lock($key, $store, 10);
143143

144144
$store
@@ -152,7 +152,7 @@ public function testRefresh()
152152
public function testRefreshCustom()
153153
{
154154
$key = new Key(uniqid(__METHOD__, true));
155-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
155+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
156156
$lock = new Lock($key, $store, 10);
157157

158158
$store
@@ -201,7 +201,7 @@ public function testRelease()
201201
public function testReleaseStoreInterface()
202202
{
203203
$key = new Key(uniqid(__METHOD__, true));
204-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
204+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
205205
$lock = new Lock($key, $store, 10);
206206

207207
$store
@@ -356,7 +356,7 @@ public function testExpiration($ttls, $expected)
356356
public function testExpirationStoreInterface($ttls, $expected)
357357
{
358358
$key = new Key(uniqid(__METHOD__, true));
359-
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
359+
$store = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
360360
$lock = new Lock($key, $store, 10);
361361

362362
foreach ($ttls as $ttl) {

src/Symfony/Component/Lock/Tests/Store/AbstractStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Lock\Exception\LockConflictedException;
1616
use Symfony\Component\Lock\Key;
17-
use Symfony\Component\Lock\StoreInterface;
17+
use Symfony\Component\Lock\PersistStoreInterface;
1818

1919
/**
2020
* @author Jérémy Derussé <jeremy@derusse.com>
2121
*/
2222
abstract class AbstractStoreTest extends TestCase
2323
{
2424
/**
25-
* @return StoreInterface
25+
* @return PersistStoreInterface
2626
*/
2727
abstract protected function getStore();
2828

src/Symfony/Component/Lock/Tests/Store/BlockingStoreTestTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Lock\Exception\LockConflictedException;
1515
use Symfony\Component\Lock\Exception\NotSupportedException;
1616
use Symfony\Component\Lock\Key;
17-
use Symfony\Component\Lock\StoreInterface;
17+
use Symfony\Component\Lock\PersistStoreInterface;
1818

1919
/**
2020
* @author Jérémy Derussé <jeremy@derusse.com>
@@ -24,7 +24,7 @@ trait BlockingStoreTestTrait
2424
/**
2525
* @see AbstractStoreTest::getStore()
2626
*
27-
* @return StoreInterface
27+
* @return PersistStoreInterface
2828
*/
2929
abstract protected function getStore();
3030

src/Symfony/Component/Lock/Tests/Store/CombinedStoreTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\Lock\PersistStoreInterface;
1818
use Symfony\Component\Lock\Store\CombinedStore;
1919
use Symfony\Component\Lock\Store\RedisStore;
20-
use Symfony\Component\Lock\StoreInterface;
2120
use Symfony\Component\Lock\Strategy\StrategyInterface;
2221
use Symfony\Component\Lock\Strategy\UnanimousStrategy;
2322

@@ -268,8 +267,8 @@ public function testputOffExpirationAbortWhenStrategyCantBeMet()
268267

269268
public function testPutOffExpirationIgnoreNonExpiringStorage()
270269
{
271-
$store1 = $this->getMockBuilder(StoreInterface::class)->getMock();
272-
$store2 = $this->getMockBuilder(StoreInterface::class)->getMock();
270+
$store1 = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
271+
$store2 = $this->getMockBuilder(PersistStoreInterface::class)->getMock();
273272

274273
$store = new CombinedStore([$store1, $store2], $this->strategy);
275274

0 commit comments

Comments
 (0)