From 0cac41258f5c8a56c69e2d4f83c30726434bf5f3 Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Tue, 26 Nov 2024 18:10:36 +0100 Subject: [PATCH] [TASK] phpstan v2 > composer req --dev phpstan/phpstan:^2.0.2 phpstan/phpstan-phpunit:^2.0.1 > Build/Scripts/runTests.sh -s phpstanGenerateBaseline -p 8.2 Releases: main, 8 --- Build/phpstan/phpstan-baseline.neon | 47 +++++++++++++++++++++++++++++ composer.json | 4 +-- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index 364905f7..d7df627a 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -1,2 +1,49 @@ parameters: ignoreErrors: + - + message: '#^Offset 0 on non\-empty\-list\ on left side of \?\? always exists and is not nullable\.$#' + identifier: nullCoalesce.offset + count: 1 + path: ../../Classes/Composer/ComposerPackageManager.php + + - + message: '#^Trait TYPO3\\TestingFramework\\Core\\AccessibleProxyTrait is used zero times and is not analysed\.$#' + identifier: trait.unused + count: 1 + path: ../../Classes/Core/AccessibleProxyTrait.php + + - + message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Metadata\\\\MetadataCollection'' and ''isWithoutErrorHandl…'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: ../../Classes/Core/BaseTestCase.php + + - + message: '#^Call to function is_array\(\) with non\-empty\-array will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: ../../Classes/Core/Functional/Framework/Constraint/RequestSection/DoesNotHaveRecordConstraint.php + + - + message: '#^Call to function is_array\(\) with non\-empty\-array will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: ../../Classes/Core/Functional/Framework/Constraint/RequestSection/HasRecordConstraint.php + + - + message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: ../../Classes/Core/Functional/Framework/DataHandling/Snapshot/DatabaseSnapshot.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: ../../Classes/Core/Functional/FunctionalTestCase.php + + - + message: '#^Strict comparison using \!\=\= between int\|string\|true and false will always evaluate to true\.$#' + identifier: notIdentical.alwaysTrue + count: 1 + path: ../../Classes/Core/Functional/FunctionalTestCase.php diff --git a/composer.json b/composer.json index cfa963a9..e999f4e1 100644 --- a/composer.json +++ b/composer.json @@ -60,8 +60,8 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.65.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-phpunit": "^1.1.1", + "phpstan/phpstan": "^2.0.2", + "phpstan/phpstan-phpunit": "^2.0.1", "typo3/cms-workspaces": "12.*.*@dev || 13.*.*@dev" }, "replace": {