Skip to content

Commit 098a747

Browse files
committed
[DoctrineBridge]rm BC layer configureSchema check database
1 parent 86a0b1f commit 098a747

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

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

Lines changed: 1 addition & 5 deletions
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

Lines changed: 1 addition & 6 deletions
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/Lock/Store/DoctrineDbalStore.php

Lines changed: 2 additions & 6 deletions
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

Lines changed: 1 addition & 5 deletions
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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy