You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownew \TypeError(sprintf('Argument 1 passed to "%s()" must be "%s" or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrUrl)));
if ($connOrDsninstanceof Connection || (\is_string($connOrDsn) && str_contains($connOrDsn, '://'))) {
74
-
trigger_deprecation('symfony/lock', '5.4', 'Usage of a DBAL Connection with "%s" is deprecated and will be removed in symfony 6.0. Use "%s" instead.', __CLASS__, DoctrineDbalStore::class);
thrownewInvalidTtlException(sprintf('"%s()" expects a TTL greater or equals to 1 second. Got "%s".', __METHOD__, $ttl));
148
127
}
@@ -171,12 +150,6 @@ public function putOffExpiration(Key $key, float $ttl)
171
150
*/
172
151
publicfunctiondelete(Key$key)
173
152
{
174
-
if (isset($this->dbalStore)) {
175
-
$this->dbalStore->delete($key);
176
-
177
-
return;
178
-
}
179
-
180
153
$sql = "DELETE FROM $this->table WHERE $this->idCol = :id AND $this->tokenCol = :token";
181
154
$stmt = $this->getConnection()->prepare($sql);
182
155
@@ -190,10 +163,6 @@ public function delete(Key $key)
190
163
*/
191
164
publicfunctionexists(Key$key): bool
192
165
{
193
-
if (isset($this->dbalStore)) {
194
-
return$this->dbalStore->exists($key);
195
-
}
196
-
197
166
$sql = "SELECT 1 FROM $this->table WHERE $this->idCol = :id AND $this->tokenCol = :token AND $this->expirationCol > {$this->getCurrentTimestampStatement()}";
198
167
$stmt = $this->getConnection()->prepare($sql);
199
168
@@ -222,12 +191,6 @@ private function getConnection(): \PDO
222
191
*/
223
192
publicfunctioncreateTable(): void
224
193
{
225
-
if (isset($this->dbalStore)) {
226
-
$this->dbalStore->createTable();
227
-
228
-
return;
229
-
}
230
-
231
194
// connect if we are not yet
232
195
$conn = $this->getConnection();
233
196
$driver = $this->getDriver();
@@ -255,22 +218,6 @@ public function createTable(): void
255
218
$conn->exec($sql);
256
219
}
257
220
258
-
/**
259
-
* Adds the Table to the Schema if it doesn't exist.
260
-
*
261
-
* @deprecated since symfony/lock 5.4 use DoctrineDbalStore instead
0 commit comments