8000 [DoctrineBridge]rm BC layer configureSchema check database · symfony/symfony@ad9d6dd · GitHub
[go: up one dir, main page]

Skip to content

Commit ad9d6dd

Browse files
committed
[DoctrineBridge]rm BC layer configureSchema check database
1 parent 0d737cf commit ad9d6dd

File tree

8 files changed

+27
-22
lines changed

8 files changed

+27
-22
lines changed

UPGRADE-7.0.md

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Symfony 6.4 and Symfony 7.0 will be released simultaneously at the end of Novemb
55
release process, both versions will have the same features, but Symfony 7.0 won't include any deprecated features.
66
To upgrade, make sure to resolve all deprecation notices.
77

8+
Cache
9+
-----
10+
11+
* Add parameter `$isSameDatabase` to `DoctrineDbalAdapter::configureSchema()`
12+
813
DoctrineBridge
914
--------------
1015

@@ -15,6 +20,12 @@ DoctrineBridge
1520
* Remove `DoctrineDataCollector::addLogger()`, use a `DebugDataHolder` instead
1621
* `ContainerAwareEventManager::getListeners()` must be called with an event name
1722
* DoctrineBridge now requires `doctrine/event-manager:^2`
23+
* Add parameter `$isSameDatabase` to `DoctrineTokenProvider::configureSchema()`
24+
25+
Messenger
26+
---------
27+
28+
* Add parameter `$isSameDatabase` to `DoctrineTransport::configureSchema()`
1829

1930
ProxyManagerBridge
2031
------------------

src/Symfony/Bridge/Doctrine/CHANGELOG.md

+1
< 10000 /thead>
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ CHANGELOG
1111
* Remove `DoctrineDataCollector::addLogger()`, use a `DebugDataHolder` instead
1212
* `ContainerAwareEventManager::getListeners()` must be called with an event name
1313
* DoctrineBridge now requires `doctrine/event-manager:^2`
14+
* Add parameter `$isSameDatabase` to `DoctrineTokenProvider::configureSchema()`
1415

1516
6.4
1617
---

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,13 @@ public function updateExistingToken(PersistentTokenInterface $token, #[\Sensitiv
179179

180180
/**
181181
* Adds the Table to the Schema if "remember me" uses this Connection.
182-
*
183-
* @param \Closure $isSameDatabase
184182
*/
185-
public function configureSchema(Schema $schema, Connection $forConnection/* , \Closure $isSameDatabase */): void
183+
public function configureSchema(Schema $schema, Connection $forConnection, \Closure $isSameDatabase): void
186184
{
187185
if ($schema->hasTable('rememberme_token')) {
188186
return;
189187
}
190188

191-
$isSameDatabase = 2 < \func_num_args() ? func_get_arg(2) : static fn () => false;
192-
193189
if ($forConnection !== $this->conn && !$isSameDatabase($this->conn->executeStatement(...))) {
194190
return;
195191
}

src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,12 @@ public function createTable(): void
117117
}
118118
}
119119

120-
/**
121-
* @param \Closure $isSameDatabase
122-
*/
123-
public function configureSchema(Schema $schema, Connection $forConnection/* , \Closure $isSameDatabase */): void
120+
public function configureSchema(Schema $schema, Connection $forConnection, \Closure $isSameDatabase): void
124121
{
125122
if ($schema->hasTable($this->table)) {
126123
return;
127124
}
128125

129-
$isSameDatabase = 2 < \func_num_args() ? func_get_arg(2) : static fn () => false;
130-
131126
if ($forConnection !== $this->conn && !$isSameDatabase($this->conn->executeStatement(...))) {
132127
return;
133128
}

src/Symfony/Component/Cache/CHANGELOG.md

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

4+
7.0
5+
---
6+
7+
* Add parameter `$isSameDatabase` to `DoctrineDbalAdapter::configureSchema()`
8+
49
6.3
510
---
611

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function exists(Key $key): bool
199199
public function createTable(): void
200200
{
201201
$schema = new Schema();
202-
$this->configureSchema($schema);
202+
$this->configureSchema($schema, static fn () => true);
203203

204204
foreach ($schema->toSql($this->conn->getDatabasePlatform()) as $sql) {
205205
$this->conn->executeStatement($sql);
@@ -208,17 +208,13 @@ public function createTable(): void
208208

209209
/**
210210
* Adds the Table to the Schema if it doesn't exist.
211-
*
212-
* @param \Closure $isSameDatabase
213211
*/
214-
public function configureSchema(Schema $schema/* , \Closure $isSameDatabase */): void
212+
public function configureSchema(Schema $schema, \Closure $isSameDatabase): void
215213
{
216214
if ($schema->hasTable($this->table)) {
217215
return;
218216
}
219217

220-
$isSameDatabase = 1 < \func_num_args() ? func_get_arg(1) : static fn () => true;
221-
222218
if (!$isSameDatabase($this->conn->executeStatement(...))) {
223219
return;
224220
}

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransport.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,9 @@ public function setup(): void
7979

8080
/**
8181
* Adds the Table to the Schema if this transport uses this connection.
82-
*
83-
* @param \Closure $isSameDatabase
8482
*/
85-
public function configureSchema(Schema $schema, DbalConnection $forConnection/* , \Closure $isSameDatabase */): void
83+
public function configureSchema(Schema $schema, DbalConnection $forConnection, \Closure $isSameDatabase): void
8684
{
87-
$isSameDatabase = 2 < \func_num_args() ? func_get_arg(2) : static fn () => false;
88-
8985
$this->connection->configureSchema($schema, $forConnection, $isSameDatabase);
9086
}
9187

src/Symfony/Component/Messenger/CHANGELOG.md

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

4+
7.0
5+
---
6+
7+
* Add parameter `$isSameDatabase` to `DoctrineTransport::configureSchema()`
8+
49
6.3
510
---
611

0 commit comments

Comments
 (0)
0