From 22f86a64e72d26e754ed547f9e1871c8573711a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:04:25 +0100 Subject: [PATCH 1/6] Bump doctrine/.github from 5.3.0 to 6.0.0 (#6642) Bumps [doctrine/.github](https://github.com/doctrine/.github) from 5.3.0 to 6.0.0.
Release notes

Sourced from doctrine/.github's releases.

PHP 8.4 by default

Changed

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=doctrine/.github&package-manager=github_actions&previous-version=5.3.0&new-version=6.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/documentation.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 19012bb126..ade637644a 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -25,4 +25,4 @@ on: jobs: coding-standards: name: "Coding Standards" - uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@6.0.0" diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 6ef2b0bb59..84bf616c87 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,4 +17,4 @@ on: jobs: documentation: name: "Documentation" - uses: "doctrine/.github/.github/workflows/documentation.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/documentation.yml@6.0.0" From 0ac3d64b6159eb2abccb7945c7969c76da30f5bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:46:31 +0100 Subject: [PATCH 2/6] Bump doctrine/.github from 6.0.0 to 7.1.0 (#6649) Bumps [doctrine/.github](https://github.com/doctrine/.github) from 6.0.0 to 7.1.0.
Release notes

Sourced from doctrine/.github's releases.

Website schema validation workflow

Added

We now have a new workflow that allows to validate modification of .doctrine-project.json files.

Drop Psalm

Removed

The Psalm workflow has been removed. We are now only relying on PHPStan.

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=doctrine/.github&package-manager=github_actions&previous-version=6.0.0&new-version=7.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/documentation.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index ade637644a..8663024eae 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -25,4 +25,4 @@ on: jobs: coding-standards: name: "Coding Standards" - uses: "doctrine/.github/.github/workflows/coding-standards.yml@6.0.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@7.1.0" diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 84bf616c87..58eb5f8145 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,4 +17,4 @@ on: jobs: documentation: name: "Documentation" - uses: "doctrine/.github/.github/workflows/documentation.yml@6.0.0" + uses: "doctrine/.github/.github/workflows/documentation.yml@7.1.0" From ff055b8c0db260f52acc2163a7a09df2ef405327 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 6 Jan 2025 13:11:49 +0100 Subject: [PATCH 3/6] PHPUnit 9.6.22 (#6691) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4680845ea9..3ccf38e172 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ "jetbrains/phpstorm-stubs": "2023.1", "phpstan/phpstan": "1.12.6", "phpstan/phpstan-strict-rules": "^1.6", - "phpunit/phpunit": "9.6.20", + "phpunit/phpunit": "9.6.22", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.10.2", From e6588ccae740bf0f2d4fc638ef16661252eb0147 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 6 Jan 2025 13:13:32 +0100 Subject: [PATCH 4/6] PHPUnit 10.5.39 (#6692) --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 3ba2e6f56d..0bb3315156 100644 --- a/composer.json +++ b/composer.json @@ -41,9 +41,9 @@ "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.2", "phpstan/phpstan": "1.12.6", - "phpstan/phpstan-phpunit": "1.4.0", + "phpstan/phpstan-phpunit": "1.4.2", "phpstan/phpstan-strict-rules": "^1.6", - "phpunit/phpunit": "10.5.30", + "phpunit/phpunit": "10.5.39", "psalm/plugin-phpunit": "0.19.0", "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.10.2", From 36aa8b41642297fcd720722b801b36ea8a8c6d17 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 6 Jan 2025 14:36:02 +0100 Subject: [PATCH 5/6] PHPStan 2.1.1 (#6690) | Q | A |------------- | ----------- | Type | improvement | Fixed issues | N/A #### Summary This PR bumps PHPStan to version 2. I've reintroduced the baseline because there are some errors that need further investigation and I did not want to block this upgrade for too long. --- .github/workflows/static-analysis.yml | 4 +- composer.json | 4 +- phpstan-baseline.neon | 181 ++++++++++++++++++ phpstan.neon.dist | 22 ++- src/Driver/API/OCI/ExceptionConverter.php | 4 +- src/Event/SchemaDropTableEventArgs.php | 7 +- src/Platforms/AbstractPlatform.php | 2 +- .../Builder/CreateSchemaObjectsSQLBuilder.php | 6 +- src/Schema/Comparator.php | 2 +- 9 files changed, 210 insertions(+), 22 deletions(-) create mode 100644 phpstan-baseline.neon diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 5fdb47196d..cea25ef1ed 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -34,7 +34,7 @@ jobs: strategy: matrix: php-version: - - "8.3" + - "8.4" steps: - name: "Checkout code" @@ -49,6 +49,8 @@ jobs: - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v3" + with: + composer-options: "--ignore-platform-req=php+" - name: "Run a static analysis with phpstan/phpstan" run: "vendor/bin/phpstan --error-format=checkstyle | cs2pr" diff --git a/composer.json b/composer.json index 3ccf38e172..7376138ab4 100644 --- a/composer.json +++ b/composer.json @@ -43,8 +43,8 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.12.6", - "phpstan/phpstan-strict-rules": "^1.6", + "phpstan/phpstan": "2.1.1", + "phpstan/phpstan-strict-rules": "^2", "phpunit/phpunit": "9.6.22", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000000..2c7c222a6a --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,181 @@ +parameters: + ignoreErrors: + - + message: '#^@readonly property cannot have a default value\.$#' + identifier: property.readOnlyByPhpDocDefaultValue + count: 1 + path: src/Driver/AbstractException.php + + - + message: '#^Method Doctrine\\DBAL\\Driver\\OCI8\\Result\:\:fetchAllAssociative\(\) should return list\\> but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Driver/OCI8/Result.php + + - + message: '#^Method Doctrine\\DBAL\\Driver\\OCI8\\Result\:\:fetchAllNumeric\(\) should return list\\> but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Driver/OCI8/Result.php + + - + message: '#^@readonly property Doctrine\\DBAL\\Driver\\PDO\\PDOException\:\:\$sqlState is assigned outside of the constructor\.$#' + identifier: property.readOnlyByPhpDocAssignNotInConstructor + count: 1 + path: src/Driver/PDO/PDOException.php + + - + message: '#^@readonly property cannot have a default value\.$#' + identifier: property.readOnlyByPhpDocDefaultValue + count: 1 + path: src/Driver/PDO/PDOException.php + + - + message: '#^Method Doctrine\\DBAL\\Driver\\PDO\\Result\:\:fetchAll\(\) should return list\ but returns array\.$#' + identifier: return.type + count: 1 + path: src/Driver/PDO/Result.php + + - + message: '#^Method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:fetchAllAssociative\(\) should return list\\> but returns array\\>\.$#' + identifier: return.type + count: 1 + path: src/Driver/PgSQL/Result.php + + - + message: '#^Method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:fetchAllNumeric\(\) should return list\\> but returns array\\>\.$#' + identifier: return.type + count: 1 + path: src/Driver/PgSQL/Result.php + + - + message: '#^Method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:fetchFirstColumn\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Driver/PgSQL/Result.php + + - + message: '#^Method Doctrine\\DBAL\\Driver\\SQLite3\\Result\:\:fetchNumeric\(\) should return list\\|false but returns array\|false\.$#' + identifier: return.type + count: 1 + path: src/Driver/SQLite3/Result.php + + - + message: '#^Method Doctrine\\DBAL\\Platforms\\AbstractMySQLPlatform\:\:getAlterTableSQL\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Platforms/AbstractMySQLPlatform.php + + - + message: '#^Parameter \#1 \$assets of method Doctrine\\DBAL\\Platforms\\AbstractMySQLPlatform\:\:indexAssetsByLowerCaseName\(\) expects list\, array\ given\.$#' + identifier: argument.type + count: 1 + path: src/Platforms/AbstractMySQLPlatform.php + + - + message: '#^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform\:\:buildCreateTableSQL\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 2 + path: src/Platforms/AbstractPlatform.php + + - + message: '#^Method Doctrine\\DBAL\\Platforms\\DB2Platform\:\:getAlterTableSQL\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Platforms/DB2Platform.php + + - + message: '#^Method Doctrine\\DBAL\\Platforms\\OraclePlatform\:\:getAlterTableSQL\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Platforms/OraclePlatform.php + + - + message: '#^Method Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform\:\:getAlterTableSQL\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Platforms/PostgreSQLPlatform.php + + - + message: '#^Method Doctrine\\DBAL\\Platforms\\SQLServerPlatform\:\:getAlterTableSQL\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 2 + path: src/Platforms/SQLServerPlatform.php + + - + message: '#^Method Doctrine\\DBAL\\Platforms\\SqlitePlatform\:\:getAlterTableSQL\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Platforms/SqlitePlatform.php + + - + message: '#^Method Doctrine\\DBAL\\Platforms\\SqlitePlatform\:\:getAlterTableSQL\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Platforms/SqlitePlatform.php + + - + message: '#^Parameter &\$knownAliases by\-ref type of method Doctrine\\DBAL\\Query\\QueryBuilder\:\:getSQLForJoins\(\) expects array\, non\-empty\-array\ given\.$#' + identifier: parameterByRef.type + count: 1 + path: src/Query/QueryBuilder.php + + - + message: '#^Property Doctrine\\DBAL\\Query\\QueryBuilder\:\:\$params \(array\\|string, mixed\>\) does not accept non\-empty\-array\\.$#' + identifier: assign.propertyType + count: 1 + path: src/Query/QueryBuilder.php + + - + message: '#^Parameter \#1 \$sequences of method Doctrine\\DBAL\\SQL\\Builder\\DropSchemaObjectsSQLBuilder\:\:buildSequenceStatements\(\) expects list\, array\ given\.$#' + identifier: argument.type + count: 1 + path: src/SQL/Builder/DropSchemaObjectsSQLBuilder.php + + - + message: '#^Parameter \#1 \$tables of method Doctrine\\DBAL\\SQL\\Builder\\DropSchemaObjectsSQLBuilder\:\:buildTableStatements\(\) expects list\, array\ given\.$#' + identifier: argument.type + count: 1 + path: src/SQL/Builder/DropSchemaObjectsSQLBuilder.php + + - + message: '#^Method Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:doListTableNames\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Schema/AbstractSchemaManager.php + + - + message: '#^Template type T is declared as covariant, but occurs in invariant position in property Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:\$_platform\.$#' + identifier: generics.variance + count: 1 + path: src/Schema/AbstractSchemaManager.php + + - + message: '#^Parameter \#1 \$tables of method Doctrine\\DBAL\\Platforms\\AbstractPlatform\:\:getDropTablesSQL\(\) expects list\, array\ given\.$#' + identifier: argument.type + count: 1 + path: src/Schema/SchemaDiff.php + + - + message: '#^Method Doctrine\\DBAL\\Schema\\SqliteSchemaManager\:\:addDetailsToTableForeignKeyColumns\(\) should return list\\> but returns array\, array\\>\.$#' + identifier: return.type + count: 1 + path: src/Schema/SqliteSchemaManager.php + + - + message: '#^Method Doctrine\\DBAL\\Schema\\TableDiff\:\:getAddedForeignKeys\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Schema/TableDiff.php + + - + message: '#^Method Doctrine\\DBAL\\Schema\\TableDiff\:\:getDroppedForeignKeys\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Schema/TableDiff.php + + - + message: '#^Method Doctrine\\DBAL\\Schema\\TableDiff\:\:getModifiedForeignKeys\(\) should return list\ but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Schema/TableDiff.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e7a2aad546..70afdb6345 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,6 @@ parameters: level: 8 - phpVersion: 80300 + phpVersion: 80402 paths: - src - static-analysis @@ -9,10 +9,6 @@ parameters: ignoreErrors: - identifier: missingType.generics - # https://github.com/doctrine/dbal/pull/3836 - # TODO: remove in 4.0.0 - - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array, array given\.\z~' - # some drivers actually do accept 2nd parameter... - '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getListTableForeignKeysSQL\(\) invoked with \d+ parameters, 1 required\.\z~' @@ -131,7 +127,7 @@ parameters: # PHPStan does not understand the array shapes returned by pg_fetch_*() methods. - '~^Parameter #1 \$row of method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:mapAssociativeRow\(\) expects array, array given\.$~' - - '~^Parameter #1 \$row of method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:mapNumericRow\(\) expects array, array given\.$~' + - '~^Parameter #1 \$row of method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:mapNumericRow\(\) expects list, .* given\.$~' # Ignore isset() checks in destructors. - '~^Property Doctrine\\DBAL\\Driver\\PgSQL\\Connection\:\:\$connection \(PgSql\\Connection\|resource\) in isset\(\) is not nullable\.$~' @@ -152,5 +148,19 @@ parameters: message: '#^Parameter \#2 \$callback of function array_reduce expects callable\(\(callable&TIn\)\|Closure\(mixed \$value\)\: mixed\|null, callable\(T\)\: T\)\: \(\(callable&TIn\)\|Closure\(mixed \$value\)\: mixed\|null\), Closure\(callable\|null, callable\)\: \(callable\(T\)\: T\) given\.$#' path: src/Portability/Converter.php + # The @throws annotations are part of a contract. Even if the default implementation doen't throw those + # exceptions, the child implementations might do so. + - + identifier: throws.unusedType + path: src/Types/Type.php + + # We don't narrow the return type of lastInsertId() yet. + - '/^Method Doctrine\\DBAL\\Driver\\.+\\Connection\:\:lastInsertId\(\) never returns (int|false) so it can be removed from the return type\.$/' + + # Unnecessarily strict type narrowing + - '~^Method Doctrine\\DBAL\\Driver\\PDO\\ParameterTypeMap\:\:convertParamType\(\) never returns \d+ so it can be removed from the return type\.$~' + includes: + - phpstan-baseline.neon + - phar://phpstan.phar/conf/bleedingEdge.neon - vendor/phpstan/phpstan-strict-rules/rules.neon diff --git a/src/Driver/API/OCI/ExceptionConverter.php b/src/Driver/API/OCI/ExceptionConverter.php index a979bc7832..64dc6335e5 100644 --- a/src/Driver/API/OCI/ExceptionConverter.php +++ b/src/Driver/API/OCI/ExceptionConverter.php @@ -32,9 +32,9 @@ final class ExceptionConverter implements ExceptionConverterInterface /** @link http://www.dba-oracle.com/t_error_code_list.htm */ public function convert(Exception $exception, ?Query $query): DriverException { - /** @psalm-var int|'HY000' $code */ + /** @psalm-var int|'HY000' $code */ // @phpstan-ignore varTag.type $code = $exception->getCode(); - /** @psalm-suppress NoInterfaceProperties */ + /** @psalm-suppress NoInterfaceProperties */ // @phpstan-ignore property.notFound, property.notFound if ($code === 'HY000' && isset($exception->errorInfo[1], $exception->errorInfo[2])) { $errorInfo = $exception->errorInfo; $exception = new PDOException($errorInfo[2], $errorInfo[1]); diff --git a/src/Event/SchemaDropTableEventArgs.php b/src/Event/SchemaDropTableEventArgs.php index f45e3a15a8..6f279e9659 100644 --- a/src/Event/SchemaDropTableEventArgs.php +++ b/src/Event/SchemaDropTableEventArgs.php @@ -4,7 +4,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\Table; -use InvalidArgumentException; /** * Event Arguments used when the SQL query for dropping tables are generated inside {@see AbstractPlatform}. @@ -21,11 +20,7 @@ class SchemaDropTableEventArgs extends SchemaEventArgs /** @var string|null */ private $sql; - /** - * @param string|Table $table - * - * @throws InvalidArgumentException - */ + /** @param string|Table $table */ public function __construct($table, AbstractPlatform $platform) { $this->table = $table; diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php index 928a5a0212..69c05e288f 100644 --- a/src/Platforms/AbstractPlatform.php +++ b/src/Platforms/AbstractPlatform.php @@ -2226,7 +2226,7 @@ private function buildCreateTableSQL(Table $table, bool $createIndexes, bool $cr } /** - * @param list $tables + * @param Table[] $tables * * @return list * diff --git a/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php b/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php index 2e392e661b..74579b3e00 100644 --- a/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php +++ b/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php @@ -34,7 +34,7 @@ public function buildSQL(Schema $schema): array } /** - * @param list $namespaces + * @param string[] $namespaces * * @return list * @@ -54,7 +54,7 @@ private function buildNamespaceStatements(array $namespaces): array } /** - * @param list
$tables + * @param Table[] $tables * * @return list * @@ -66,7 +66,7 @@ private function buildTableStatements(array $tables): array } /** - * @param list $sequences + * @param Sequence[] $sequences * * @return list * diff --git a/src/Schema/Comparator.php b/src/Schema/Comparator.php index 28e7f2f73b..8114ec5e25 100644 --- a/src/Schema/Comparator.php +++ b/src/Schema/Comparator.php @@ -636,7 +636,7 @@ public function diffColumn(Column $column1, Column $column2) // null != 0, null != false, null != '' etc. This affects platform's table alteration SQL generation. if ( ($properties1['default'] === null) !== ($properties2['default'] === null) - || $properties1['default'] != $properties2['default'] + || $properties1['default'] != $properties2['default'] // @phpstan-ignore notEqual.notAllowed ) { $changedProperties[] = 'default'; } From 8725a81b4fbaff762b9bbf2bc929e3fbb84257c2 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 6 Jan 2025 19:40:12 +0100 Subject: [PATCH 6/6] Cleanup obsolete PHPStan ignore rules (#6697) --- phpstan.neon.dist | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 875015316e..27b53826df 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -67,12 +67,6 @@ parameters: message: '~^Parameter #1 \$params of method Doctrine\\DBAL\\Driver\:\:connect\(\) expects array~' path: tests/Driver/PDO/*/DriverTest.php - # DriverManagerTest::testDatabaseUrl() should be refactored as it's too dynamic. - - - message: '~^Offset string does not exist on array{.+}\.$~' - paths: - - tests/DriverManagerTest.php - # There is no way to make this assertion in the code, # and the API doesn't support parametrization of returned column types. - @@ -87,31 +81,9 @@ parameters: - '~^Parameter #1 \$row of method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:mapAssociativeRow\(\) expects array, array given\.$~' - '~^Parameter #1 \$row of method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:mapNumericRow\(\) expects list, .* given\.$~' - # https://github.com/phpstan/phpstan-src/pull/2224 - - - message: '~^Method Doctrine\\DBAL\\Driver\\Mysqli\\Connection\:\:exec\(\) should return int\|numeric\-string but returns int\|string\.$~' - count: 1 - path: src/Driver/Mysqli/Connection.php - - # https://github.com/phpstan/phpstan/issues/9429 - - - message: '~^Strict comparison using === between int<0, max> and false will always evaluate to false.$~' - paths: - - src/Driver/IBMDB2/Connection.php - - src/Driver/IBMDB2/Result.php - - # Ignore the possible false return value of db2_num_rows(). - - '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\Connection\:\:exec\(\) should return int but returns int<0, max>\|false\.$~' - - '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\Result\:\:rowCount\(\) should return int but returns int<0, max>\|false\.$~' - # Required for Psalm compatibility - '~^Property Doctrine\\DBAL\\Tests\\Types\\BaseDateTypeTestCase\:\:\$currentTimezone \(non-empty-string\) does not accept string\.$~' - # This is a rather complicated closure setup. We understand this, so PHPStan doesn't have to. - - - message: '#^Parameter \#2 \$callback of function array_reduce expects callable\(\(callable&TIn\)\|Closure\(mixed \$value\)\: mixed\|null, callable\(T\)\: T\)\: \(\(callable&TIn\)\|Closure\(mixed \$value\)\: mixed\|null\), Closure\(callable\|null, callable\)\: \(callable\(T\)\: T\) given\.$#' - path: src/Portability/Converter.php - # The @throws annotations are part of a contract. Even if the default implementation doen't throw those # exceptions, the child implementations might do so. - @@ -125,10 +97,6 @@ parameters: # TODO: remove in 5.0.0 - '~^Call to function method_exists\(\) with Doctrine\\DBAL\\Driver\\Result and ''getColumnName'' will always evaluate to true\.$~' - # PHPStan does not know the new PDO classes yet. - - '~^Class Pdo\\\w+ not found\.$~' - - '~^Call to an undefined static method PDO\:\:connect\(\)\.$~' - # TODO: Review these errors and fix them. - identifier: phpunit.assertEquals includes: