From 7f0d7819b5b57afd0512e0aaf2827f7a1e9bf132 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Sat, 20 Dec 2025 20:54:49 +0100 Subject: [PATCH] fix: remove Composer cache from PHPStan job and clean baseline The CI workflow was using a Composer cache with restore-keys that could restore outdated dependencies from previous builds. This caused PHPStan to detect errors for missing generic types in Symfony Config classes, even though recent versions (8.0+) include these type annotations. Changes: - Remove Composer cache from phpstan job - phpstan now installs fresh dependencies on each run - Remove obsolete PHPStan baseline entries for Configuration generic types - These errors no longer appear with Symfony Config 8.0+ This ensures consistent PHPStan results between local and CI environments. --- .ci-tools/phpstan-baseline.neon | 47 --------------------------------- .github/workflows/ci.yml | 10 +++---- 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/.ci-tools/phpstan-baseline.neon b/.ci-tools/phpstan-baseline.neon index 6629816c..a678d9fc 100644 --- a/.ci-tools/phpstan-baseline.neon +++ b/.ci-tools/phpstan-baseline.neon @@ -528,53 +528,6 @@ parameters: count: 3 path: ../src/symfony/src/DependencyInjection/Configuration.php - - - rawMessage: 'Method Webauthn\Bundle\DependencyInjection\Configuration::getConfigTreeBuilder() return type with generic class Symfony\Component\Config\Definition\Builder\TreeBuilder does not specify its types: T' - identifier: missingType.generics - count: 1 - path: ../src/symfony/src/DependencyInjection/Configuration.php - - - - rawMessage: 'PHPDoc tag `@var` for variable $rootNode contains generic class Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition but does not specify its types: TParent' - identifier: missingType.generics - path: ../src/symfony/src/DependencyInjection/Configuration.php - - - - rawMessage: 'Method Webauthn\Bundle\DependencyInjection\Configuration::addCreationProfilesConfig() has parameter $rootNode with generic class Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition but does not specify its types: TParent' - identifier: missingType.generics - count: 1 - path: ../src/symfony/src/DependencyInjection/Configuration.php - - - - rawMessage: 'Method Webauthn\Bundle\DependencyInjection\Configuration::addRequestProfilesConfig() has parameter $rootNode with generic class Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition but does not specify its types: TParent' - identifier: missingType.generics - count: 1 - path: ../src/symfony/src/DependencyInjection/Configuration.php - - - - rawMessage: 'Method Webauthn\Bundle\DependencyInjection\Configuration::addControllersConfig() has parameter $rootNode with generic class Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition but does not specify its types: TParent' - identifier: missingType.generics - count: 1 - path: ../src/symfony/src/DependencyInjection/Configuration.php - - - - rawMessage: 'Method Webauthn\Bundle\DependencyInjection\Configuration::addMetadataConfig() has parameter $rootNode with generic class Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition but does not specify its types: TParent' - identifier: missingType.generics - count: 1 - path: ../src/symfony/src/DependencyInjection/Configuration.php - - - - rawMessage: 'Method Webauthn\Bundle\DependencyInjection\Configuration::addPasskeyEndpointsConfig() has parameter $rootNode with generic class Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition but does not specify its types: TParent' - identifier: missingType.generics - count: 1 - path: ../src/symfony/src/DependencyInjection/Configuration.php - - - - rawMessage: 'Method Webauthn\Bundle\DependencyInjection\Configuration::getUrlNode() return type with generic class Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition does not specify its types: TParent' - identifier: missingType.generics - count: 1 - path: ../src/symfony/src/DependencyInjection/Configuration.php - - rawMessage: ''' Access to constant on deprecated interface Webauthn\Bundle\Repository\PublicKeyCredentialSourceRepositoryInterface: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd15422b..c9a2aa0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,18 +65,16 @@ jobs: phpstan: name: "1️⃣ Static Analysis (PHPStan)" - needs: [prepare_dependencies] + needs: [pre_checks] runs-on: ubuntu-latest container: image: ghcr.io/spomky-labs/phpqa:8.4 steps: - uses: actions/checkout@v6 - - uses: actions/cache@v4 + - uses: ramsey/composer-install@v3 with: - path: | - vendor - ~/.composer/cache - key: ${{ needs.prepare_dependencies.outputs.cache-key }} + dependency-versions: highest + composer-options: --optimize-autoloader - run: castor phpstan ecs: