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
if (!$connOrUrl->getDatabasePlatform() instanceof PostgreSQLPlatform) {
47
45
thrownewInvalidArgumentException(sprintf('The adapter "%s" does not support the "%s" platform.', __CLASS__, \get_class($connOrUrl->getDatabasePlatform())));
48
46
}
49
47
$this->conn = $connOrUrl;
50
-
} elseif (\is_string($connOrUrl)) {
48
+
} else {
51
49
if (!class_exists(DriverManager::class)) {
52
50
thrownewInvalidArgumentException(sprintf('Failed to parse the DSN "%s". Try running "composer require doctrine/dbal".', $connOrUrl));
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, '://'))) {
58
-
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__, DoctrineDbalPostgreSqlStore::class);
if (\PDO::ERRMODE_EXCEPTION !== $connOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) {
66
56
thrownewInvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)).', __METHOD__));
67
57
}
68
58
69
-
$this->conn = $connOrDsn;
70
-
$this->checkDriver();
71
-
} elseif ($connOrDsninstanceof Connection) {
72
59
$this->conn = $connOrDsn;
73
60
$this->checkDriver();
74
61
} else {
@@ -82,12 +69,6 @@ public function __construct(\PDO|Connection|string $connOrDsn, array $options =
82
69
83
70
publicfunctionsave(Key$key)
84
71
{
85
-
if (isset($this->dbalStore)) {
86
-
$this->dbalStore->save($key);
87
-
88
-
return;
89
-
}
90
-
91
72
// prevent concurrency within the same connection
92
73
$this->getInternalStore()->save($key);
93
74
@@ -110,12 +91,6 @@ public function save(Key $key)
110
91
111
92
publicfunctionsaveRead(Key$key)
112
93
{
113
-
if (isset($this->dbalStore)) {
114
-
$this->dbalStore->saveRead($key);
115
-
116
-
return;
117
-
}
118
-
119
94
// prevent concurrency within the same connection
120
95
$this->getInternalStore()->saveRead($key);
121
96
@@ -139,12 +114,6 @@ public function saveRead(Key $key)
0 commit comments