8000 Fix wrong interface for MongoDbStore · symfony/symfony@69ab527 · GitHub
[go: up one dir, main page]

Skip to content

Commit 69ab527

Browse files
committed
Fix wrong interface for MongoDbStore
1 parent 1bdae34 commit 69ab527

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

src/Symfony/Component/Lock/Store/MongoDbStore.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
use MongoDB\Exception\DriverRuntimeException;
2020
use MongoDB\Exception\InvalidArgumentException as MongoInvalidArgumentException;
2121
use MongoDB\Exception\UnsupportedException;
22-
use Symfony\Component\Lock\BlockingStoreInterface;
2322
use Symfony\Component\Lock\Exception\InvalidArgumentException;
2423
use Symfony\Component\Lock\Exception\InvalidTtlException;
2524
use Symfony\Component\Lock\Exception\LockAcquiringException;
2625
use Symfony\Component\Lock\Exception\LockConflictedException;
2726
use Symfony\Component\Lock\Exception\LockExpiredException;
2827
use Symfony\Component\Lock\Exception\LockStorageException;
29-
use Symfony\Component\Lock\Exception\NotSupportedException;
3028
use Symfony\Component\Lock\Key;
29+
use Symfony\Component\Lock\PersistingStoreInterface;
3130

3231
/**
3332
* MongoDbStore is a StoreInterface implementation using MongoDB as a storage
@@ -46,7 +45,7 @@
4645
*
4746
* @author Joe Bennett <joe@assimtech.com>
4847
*/
49-
class MongoDbStore implements BlockingStoreInterface
48+
class MongoDbStore implements PersistingStoreInterface
5049
{
5150
private $collection;
5251
private $client;
@@ -224,14 +223,6 @@ public function save(Key $key)
224223
$this->checkNotExpired($key);
225224
}
226225

227-
/**
228-
* {@inheritdoc}
229-
*/
230-
public function waitAndSave(Key $key)
231-
{
232-
throw new NotSupportedException(sprintf('The store "%s" does not support blocking locks.', __CLASS__));
233-
}
234-
235226
/**
236227
* {@inheritdoc}
237228
*

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use MongoDB\Client;
1515
use MongoDB\Driver\Exception\ConnectionTimeoutException;
1616
use Symfony\Component\Lock\Exception\InvalidArgumentException;
17-
use Symfony\Component\Lock\Exception\NotSupportedException;
1817
use Symfony\Component\Lock\Key;
1918
use Symfony\Component\Lock\PersistingStoreInterface;
2019
use Symfony\Component\Lock\Store\MongoDbStore;
@@ -81,17 +80,6 @@ public function testCreateIndex()
8180
$this->assertContains('expires_at_1', $indexes);
8281
}
8382

84-
public function testNonBlocking()
85-
{
86-
$this->expectException(NotSupportedException::class);
87-
88-
$store = $this->getStore();
89-
90-
$key = new Key(uniqid(__METHOD__, true));
91-
92-
$store->waitAndSave($key);
93-
}
94-
9583
/**
9684
* @dataProvider provideConstructorArgs
9785
*/

0 commit comments

Comments
 (0)
0