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

Skip to content
< 8000 div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full"> Dismiss alert

Commit 14fa83e

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

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

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/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

0 commit comments

Comments
 (0)
0