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
thrownewInvalidArgumentException(sprintf('"%s" requires Doctrine\DBAL\Connection instance or DSN string as first argument, "%s" given.', __CLASS__, get_debug_type($connOrDsn)));
56
+
thrownew\TypeError(sprintf('Argument 1 passed to "%s()" must be %s or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrDsn)));
57
57
}
58
58
}
59
59
@@ -207,8 +207,9 @@ private function unlockShared(Key $key): void
207
207
208
208
/**
209
209
* Check driver and remove scheme extension from DSN.
210
-
* Input: pgsql+advisory://server/
211
-
* Output: pgsql://server/
210
+
* Input: pgsql+advisory://server/
211
+
* Output: pgsql://server/
212
+
*
212
213
* @throws InvalidArgumentException when driver is not supported.
213
214
*/
214
215
privatefunctionfilterDsn(string$dsn): string
@@ -218,20 +219,15 @@ private function filterDsn(string $dsn): string
218
219
}
219
220
220
221
[$scheme, $rest] = explode(':', $dsn,2);
221
-
222
-
$driver = $scheme;
223
-
if (str_contains($scheme, '+')) {
224
-
[$driver] = explode('+', $scheme, 2);
225
-
}
226
-
227
-
if (!in_array($driver, ['pgsql', 'postgres', 'postgresql'])) {
222
+
$driver = strtok($scheme, '+');
223
+
if (!\in_array($driver, ['pgsql', 'postgres', 'postgresql'])) {
228
224
thrownewInvalidArgumentException(sprintf('The adapter "%s" does not support the "%s" driver.', __CLASS__, $driver));
thrownewInvalidArgumentException(sprintf('"%s" requires "Doctrine\DBAL\Connection" instance or DSN string as first argument, "%s" given.', __CLASS__, get_debug_type($connOrDsn)));
73
+
thrownew\TypeError(sprintf('Argument 1 passed to "%s()" must be %s or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrDsn)));
74
74
}
75
75
}
76
76
@@ -211,18 +211,21 @@ private function getCurrentTimestampStatement(): string
0 commit comments