Skip to content

fix: remove Composer cache from PHPStan job to ensure fresh dependencies#795

Merged
Spomky merged 1 commit into5.3.xfrom
fix-ci-composer-cache
Dec 20, 2025
Merged

fix: remove Composer cache from PHPStan job to ensure fresh dependencies#795
Spomky merged 1 commit into5.3.xfrom
fix-ci-composer-cache

Conversation

@Spomky
Copy link
Contributor

@Spomky Spomky commented Dec 20, 2025

Problem

The CI workflow's PHPStan job was using a Composer cache with restore-keys that could restore outdated dependencies from any previous build. Since composer.lock is not versioned in this repository, the cache key fell back to composer-Linux-, allowing very old dependency versions to be reused.

This caused PHPStan to detect errors for missing generic type annotations in Symfony Config classes, even though recent versions (8.0+) include these annotations.

Solution

  • Remove Composer cache from the PHPStan job
  • PHPStan now installs fresh dependencies using dependency-versions: highest on each run
  • Remove obsolete PHPStan baseline entries for Configuration generic types (no longer needed with Symfony 8.0+)

Benefits

  • Ensures consistent PHPStan results between local and CI environments
  • Always uses the latest dependency versions for static analysis
  • Fixes failing PHPStan checks on 5.3.x branch

Testing

The baseline cleanup was validated by running castor phpstan locally with Symfony Config 8.0.1, which no longer reports these generic type errors.


Fixes the PHPStan failures on branches like #787 and the current 5.3.x 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.
@Spomky Spomky merged commit 230adc5 into 5.3.x Dec 20, 2025
16 of 17 checks passed
@Spomky Spomky deleted the fix-ci-composer-cache branch December 20, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant