Move DBAL 3.x/4.x compatibility ignore to global phpstan config

(cherry picked from commit 2c61ba6353)
This commit is contained in:
Rafikooo 2026-02-06 15:20:37 +01:00 committed by Grzegorz Sadowski
parent c97ce1af28
commit e204f6a602
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
4 changed files with 8 additions and 3 deletions

View file

@ -39,7 +39,7 @@
"doctrine/collections": "^2.2",
"doctrine/common": "^3.2",
"doctrine/dbal": "^3.9 || ^4.0",
"doctrine/doctrine-bundle": "^2.0 || ^3.0",
"doctrine/doctrine-bundle": "^2.13 || ^3.0",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/event-manager": "^2.0",
"doctrine/inflector": "^2.0",

View file

@ -59,3 +59,10 @@ parameters:
identifier: arguments.count
count: 1
path: src/Sylius/Bundle/ShopBundle/Router/LocaleStrippingRouter.php
# DBAL 3.x/4.x compatibility - getSchemaManager() removed in DBAL 4.x
-
message: '/Call to an undefined method Doctrine\\DBAL\\Connection::getSchemaManager\(\)\./'
identifier: method.notFound
paths:
- src/Sylius/Bundle/CoreBundle/Migrations/

View file

@ -63,7 +63,6 @@ final class Version20251126120000 extends AbstractMigration
if (method_exists($this->connection, 'createSchemaManager')) {
$indexes = $this->connection->createSchemaManager()->listTableIndexes($tableName);
} else {
/** @phpstan-ignore method.notFound (DBAL 3.x compatibility) */
$indexes = $this->connection->getSchemaManager()->listTableIndexes($tableName);
}

View file

@ -63,7 +63,6 @@ final class Version20251126120001 extends AbstractPostgreSQLMigration
if (method_exists($this->connection, 'createSchemaManager')) {
$indexes = $this->connection->createSchemaManager()->listTableIndexes($tableName);
} else {
/** @phpstan-ignore method.notFound (DBAL 3.x compatibility) */
$indexes = $this->connection->getSchemaManager()->listTableIndexes($tableName);
}