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

Skip to content

Commit 201af4f

Browse files
committed
fix constructor argument type declaration
1 parent 5e75edf commit 201af4f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

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(PersistingStoreInterface $store)
3232
{
3333
$this->store = $store;
3434

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

Lines changed: 16 additions & 0 deletions
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\PersistingStoreInterface;
1819
use Symfony\Component\Lock\StoreInterface;
1920

2021
/**
@@ -23,6 +24,21 @@
2324
class LockFactoryTest extends TestCase
2425
{
2526
public function testCreateLock()
27+
{
28+
$store = $this->getMockBuilder(PersistingStoreInterface::class)->getMock();
29+
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
30+
$factory = new LockFactory($store);
31+
$factory->setLogger($logger);
32+
33+
$lock = $factory->createLock('foo');
34+
35+
$this->assertInstanceOf(LockInterface::class, $lock);
36+
}
37+
38+
/**
39+
* @group legacy
40+
*/
41+
public function testCreateLockWithLegacyStoreImplementation()
2642
{
2743
$store = $this->getMockBuilder(StoreInterface::class)->getMock();
2844
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

0 commit comments

Comments
 (0)