8000 Update changelogs · symfony/symfony@14d99b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 14d99b6

Browse files
committed
Update changelogs
1 parent 2244bec commit 14d99b6

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

UPGRADE-5.4.md

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ HttpFoundation
4141

4242
* Mark `Request::get()` internal, use explicit input sources instead
4343

44+
Lock
45+
----
46+
47+
* Deprecate usage of `PdoStore` with a `Doctrine\DBAL\Connection` or a DBAL url, use the new `DoctrineDbalStore` instead
48+
* Deprecate usage of `PostgreSqlStore` with a `Doctrine\DBAL\Connection` or a DBAL url, use the new `DoctrineDbalPostgreSqlStore` instead
49+
4450
Messenger
4551
---------
4652

UPGRADE-6.0.md

+2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ Lock
139139

140140
* Removed the `NotSupportedException`. It shouldn't be thrown anymore.
141141
* Removed the `RetryTillSaveStore`. Logic has been moved in `Lock` and is not needed anymore.
142+
* Removed usage of `PdoStore` with a `Doctrine\DBAL\Connection` or a DBAL url, use the new `DoctrineDbalStore` instead
143+
* Removed usage of `PostgreSqlStore` with a `Doctrine\DBAL\Connection` or a DBAL url, use the new `DoctrineDbalPostgreSqlStore` instead
142144

143145
Mailer
144146
------

src/Symfony/Component/Lock/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
CHANGELOG
22
=========
33

4+
5.4.0
5+
-----
6+
7+
* added `DoctrineDbalStore` identical to `PdoStore` for `Doctrine\DBAL\Connection` or DBAL url
8+
* deprecated usage of `PdoStore` with `Doctrine\DBAL\Connection` or DBAL url
9+
* added `DoctrineDbalPostgreSqlStore` identical to `PdoPostgreSqlStore` for `Doctrine\DBAL\Connection` or DBAL url
10+
* deprecated usage of `PdoPostgreSqlStore` with `Doctrine\DBAL\Connection` or DBAL url
11+
412
5.2.0
513
-----
614

src/Symfony/Component/Lock/Store/DoctrineDbalPostgreSqlStore.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,26 @@ class DoctrineDbalPostgreSqlStore implements BlockingSharedLockStoreInterface, B
3434

3535
/**
3636
* 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.
3838
*
39-
* @param Connection|string $connOrDsn A Connection instance or DSN string
39+
* @param Connection|string $connOrUrl A Connection instance or Doctrine URL
4040
*
4141
* @throws InvalidArgumentException When first argument is not Connection nor string
4242
*/
43-
public function __construct($connOrDsn)
43+
public function __construct($connOrUrl)
4444
{
45-
if ($connOrDsn instanceof Connection) {
46-
if (!$connOrDsn->getDatabasePlatform() instanceof PostgreSQLPlatform) {
47-
throw new InvalidArgumentException(sprintf('The adapter "%s" does not support the "%s" platform.', __CLASS__, \get_class($connOrDsn->getDatabasePlatform())));
45+
if ($connOrUrl instanceof Connection) {
46+
if (!$connOrUrl->getDatabasePlatform() instanceof PostgreSQLPlatform) {
47+
throw new InvalidArgumentException(sprintf('The adapter "%s" does not support the "%s" platform.', __CLASS__, \get_class($connOrUrl->getDatabasePlatform())));
4848
}
49-
$this->conn = $connOrDsn;
50-
} elseif (\is_string($connOrDsn)) {
49+
$this->conn = $connOrUrl;
50+
} elseif (\is_string($connOrUrl)) {
5151
if (!class_exists(DriverManager::class)) {
52-
throw new InvalidArgumentException(sprintf('Failed to parse the DSN "%s". Try running "composer require doctrine/dbal".', $connOrDsn));
52+
throw new InvalidArgumentException(sprintf('Failed to parse the DSN "%s". Try running "composer require doctrine/dbal".', $connOrUrl));
5353
}
54-
$this->conn = DriverManager::getConnection(['url' => $this->filterDsn($connOrDsn)]);
54+
$this->conn = DriverManager::getConnection(['url' => $this->filterDsn($connOrUrl)]);
5555
} else {
56-
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be "%s" or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrDsn)));
56+
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be "%s" or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrUrl)));
5757
}
5858
}
5959

src/Symfony/Component/Lock/Store/DoctrineDbalStore.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,27 @@ class DoctrineDbalStore implements PersistingStoreInterface
5050
* * db_token_col: The column where to store the lock token [default: key_token]
5151
* * db_expiration_col: The column where to store the expiration [default: key_expiration].
5252
*
53-
* @param Connection|string $connOrDsn A DBAL Connection instance or Doctrine DSN string
53+
* @param Connection|string $connOrUrl A DBAL Connection instance or Doctrine URL
5454
* @param array $options An associative array of options
5555
* @param float $gcProbability Probability expressed as floating number between 0 and 1 to clean old locks
5656
* @param int $initialTtl The expiration delay of locks in seconds
5757
*
5858
* @throws InvalidArgumentException When namespace contains invalid characters
5959
* @throws InvalidArgumentException When the initial ttl is not valid
6060
*/
61-
public function __construct($connOrDsn, array $options = [], float $gcProbability = 0.01, int $initialTtl = 300)
61+
public function __construct($connOrUrl, array $options = [], float $gcProbability = 0.01, int $initialTtl = 300)
6262
{
6363
$this->init($options, $gcProbability, $initialTtl);
6464

65-
if ($connOrDsn instanceof Connection) {
66-
$this->conn = $connOrDsn;
67-
} elseif (\is_string($connOrDsn)) {
65+
if ($connOrUrl instanceof Connection) {
66+
$this->conn = $connOrUrl;
67+
} elseif (\is_string($connOrUrl)) {
6868
if (!class_exists(DriverManager::class)) {
69-
throw new InvalidArgumentException(sprintf('Failed to parse the DSN "%s". Try running "composer require doctrine/dbal".', $connOrDsn));
69+
throw new InvalidArgumentException(sprintf('Failed to parse the DSN "%s". Try running "composer require doctrine/dbal".', $connOrUrl));
7070
}
71-
$this->conn = DriverManager::getConnection(['url' => $connOrDsn]);
71+
$this->conn = DriverManager::getConnection(['url' => $connOrUrl]);
7272
} else {
73-
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be "%s" or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrDsn)));
73+
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be "%s" or string, "%s" given.', Connection::class, __METHOD__, get_debug_type($connOrUrl)));
7474
}
7575
}
7676

0 commit comments

Comments
 (0)
0