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/MysqlStore.php
+39-12Lines changed: 39 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -23,19 +23,25 @@
23
23
*/
24
24
class MysqlStore implements PersistingStoreInterface
25
25
{
26
-
private\PDO$conn;
26
+
private?\PDO$conn;
27
27
28
-
publicfunction__construct(\PDO$conn)
29
-
{
30
-
if ('mysql' !== $driver = $conn->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
31
-
thrownewInvalidArgumentException(sprintf('The adapter "%s" does not support the "%s" driver.', __CLASS__, $driver));
32
-
}
28
+
private ?string$dsn;
29
+
30
+
privatearray$options;
33
31
34
-
if (\PDO::ERRMODE_EXCEPTION !== $conn->getAttribute(\PDO::ATTR_ERRMODE)) {
35
-
thrownewInvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)).', __METHOD__));
if (\PDO::ERRMODE_EXCEPTION !== $this->conn->getAttribute(\PDO::ATTR_ERRMODE)) {
38
+
thrownewInvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)).', __METHOD__));
39
+
}
40
+
} else {
41
+
$this->dsn = $connOrDsn;
36
42
}
37
43
38
-
$this->conn = $conn;
44
+
$this->options = $options;
39
45
}
40
46
41
47
publicfunctionsave(Key$key): void
@@ -44,11 +50,9 @@ public function save(Key $key): void
0 commit comments