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
Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Store/DoctrineDbalPostgreSqlStore.php
+11-11
Original file line number
Diff line number
Diff line change
@@ -34,26 +34,26 @@ class DoctrineDbalPostgreSqlStore implements BlockingSharedLockStoreInterface, B
34
34
35
35
/**
36
36
* You can either pass an existing database connection a Doctrine DBAL Connection
37
-
* or a DSN string that will be used to connect to the database.
37
+
* or a URL that will be used to connect to the database.
38
38
*
39
-
* @param Connection|string $connOrDsn A Connection instance or DSN string
39
+
* @param Connection|string $connOrUrl A Connection instance or Doctrine URL
40
40
*
41
41
* @throws InvalidArgumentException When first argument is not Connection nor string
42
42
*/
43
-
publicfunction__construct($connOrDsn)
43
+
publicfunction__construct($connOrUrl)
44
44
{
45
-
if ($connOrDsninstanceof Connection) {
46
-
if (!$connOrDsn->getDatabasePlatform() instanceof PostgreSQLPlatform) {
47
-
thrownewInvalidArgumentException(sprintf('The adapter "%s" does not support the "%s" platform.', __CLASS__, \get_class($connOrDsn->getDatabasePlatform())));
45
+
if ($connOrUrlinstanceof Connection) {
46
+
if (!$connOrUrl->getDatabasePlatform() instanceof PostgreSQLPlatform) {
47
+
thrownewInvalidArgumentException(sprintf('The adapter "%s" does not support the "%s" platform.', __CLASS__, \get_class($connOrUrl->getDatabasePlatform())));
48
48
}
49
-
$this->conn = $connOrDsn;
50
-
} elseif (\is_string($connOrDsn)) {
49
+
$this->conn = $connOrUrl;
50
+
} elseif (\is_string($connOrUrl)) {
51
51
if (!class_exists(DriverManager::class)) {
52
-
thrownewInvalidArgumentException(sprintf('Failed to parse the DSN "%s". Try running "composer require doctrine/dbal".', $connOrDsn));
52
+
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($connOrDsn)));
56
+
thrownew \TypeError(sprintf('Argument 1 passed to "%s()" must be "%s" or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrUrl)));
thrownew \TypeError(sprintf('Argument 1 passed to "%s()" must be "%s" or string, "%s" given.', Connection::class, __METHOD__, 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($connOrUrl)));
0 commit comments