From 0ed0be089cb6c583b917cd7b833e125495917352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 7 Dec 2024 13:36:37 +0100 Subject: [PATCH] Run static analysis checks on PHP 8.4 (#11753) * Run static analysis checks on PHP 8.4 * Remove forgotten references to Psalm * Remove invalid annotation I do not think it achieves anything. --- .gitattributes | 2 -- .github/workflows/static-analysis.yml | 5 +---- phpstan-baseline.neon | 5 ----- phpstan-params.neon | 2 +- tests/Tests/Models/Enums/FaultySwitch.php | 2 -- 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.gitattributes b/.gitattributes index 1b71dc4e5b3..cec212e0701 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,5 +19,3 @@ phpstan-baseline.neon export-ignore phpstan-dbal2.neon export-ignore phpstan-params.neon export-ignore phpstan-persistence2.neon export-ignore -psalm.xml export-ignore -psalm-baseline.xml export-ignore diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index dda82aa6a5b..23327aeda5f 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -9,7 +9,6 @@ on: - composer.* - src/** - phpstan* - - psalm* - tests/StaticAnalysis/** push: branches: @@ -19,7 +18,6 @@ on: - composer.* - src/** - phpstan* - - psalm* - tests/StaticAnalysis/** jobs: @@ -48,7 +46,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "8.3" + php-version: "8.4" - name: "Require specific DBAL version" run: "composer require doctrine/dbal ^${{ matrix.dbal-version }} --no-update" @@ -73,4 +71,3 @@ jobs: - name: "Run a static analysis with phpstan/phpstan" run: "vendor/bin/phpstan analyse -c phpstan-persistence2.neon" if: "${{ matrix.dbal-version == 'default' && matrix.persistence-version != 'default'}}" - diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 364f23f8b0e..cae90074b6f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1055,11 +1055,6 @@ parameters: count: 1 path: src/Mapping/ClassMetadataFactory.php - - - message: "#^Call to an undefined method ReflectionProperty\\:\\:getHooks\\(\\)\\.$#" - count: 1 - path: src/Mapping/ClassMetadataInfo.php - - message: "#^Method Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\:\\:_storeAssociationMapping\\(\\) has parameter \\$assocMapping with no value type specified in iterable type array\\.$#" count: 5 diff --git a/phpstan-params.neon b/phpstan-params.neon index 588d4116b18..0c2be606f79 100644 --- a/phpstan-params.neon +++ b/phpstan-params.neon @@ -8,7 +8,7 @@ parameters: earlyTerminatingMethodCalls: Doctrine\ORM\Query\Parser: - syntaxError - phpVersion: 80200 + phpVersion: 80400 ignoreErrors: # Remove on 3.0.x diff --git a/tests/Tests/Models/Enums/FaultySwitch.php b/tests/Tests/Models/Enums/FaultySwitch.php index f70cc6f3653..dcb01d446cb 100644 --- a/tests/Tests/Models/Enums/FaultySwitch.php +++ b/tests/Tests/Models/Enums/FaultySwitch.php @@ -14,8 +14,6 @@ class FaultySwitch /** * The following line is ignored on psalm and phpstan so that we can test * that the mapping is throwing an exception when a non-backed enum is used. - * - * @phpstan-suppress InvalidArgument */ #[Column(enumType: SwitchStatus::class)] public SwitchStatus $status;