Skip to content

Commit 8bcfb82

Browse files
authored
Fixed DBAL schema asset usage (#178)
* Fixed DBAL schema asset filter argument * Fixed deprecated using null schema asset filter * Fixed checkstyle
1 parent 5a5d567 commit 8bcfb82

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/batch-doctrine-dbal/src/DoctrineDBALJobExecutionStorage.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Doctrine\DBAL\Driver\Result;
99
use Doctrine\DBAL\Exception as DBALException;
1010
use Doctrine\DBAL\Query\QueryBuilder;
11+
use Doctrine\DBAL\Schema\AbstractAsset;
1112
use Doctrine\DBAL\Schema\Comparator;
1213
use Doctrine\DBAL\Schema\Schema;
1314
use Doctrine\DBAL\Types\Types;
@@ -60,10 +61,13 @@ public function __construct(ConnectionRegistry $doctrine, array $options)
6061
*/
6162
public function setup(): void
6263
{
63-
$assetFilter = $this->connection->getConfiguration()->getSchemaAssetsFilter();
64-
$this->connection->getConfiguration()->setSchemaAssetsFilter(
65-
fn(string $tableName) => $tableName === $this->table,
66-
);
64+
$assetFilter = $this->connection->getConfiguration()->getSchemaAssetsFilter()
65+
?? fn() => true;
66+
$this->connection->getConfiguration()->setSchemaAssetsFilter(function (string|AbstractAsset $table) {
67+
$table = $table instanceof AbstractAsset ? $table->getName() : $table;
68+
69+
return $table === $this->table;
70+
});
6771

6872
$schemaManager = \method_exists($this->connection, 'createSchemaManager')
6973
? $this->connection->createSchemaManager()

src/batch-symfony-messenger/src/MessengerJobsConfiguration.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
final class MessengerJobsConfiguration
1111
{
1212
public function __construct(
13-
/** @var array<string, string> */
13+
/**
14+
* @var array<string, string>
15+
*/
1416
private array $routing,
1517
) {
1618
}

0 commit comments

Comments
 (0)