Skip to content

Conversation

@Rafikooo
Copy link
Contributor

@Rafikooo Rafikooo commented Oct 27, 2025

Why?

We are migrating all Sylius repositories from Psalm to PHPStan for better static analysis consistency across the ecosystem.

What was done?

  • Replaced Psalm with PHPStan in CI workflow
  • Set PHPStan to max level with a baseline to track existing issues
  • Generated baseline file containing 561 existing issues to prevent regression while allowing gradual improvement
  • Configured comprehensive ignore rules for optional dependencies (MongoDB ODM, PHPCR, deprecated packages)
  • Fixed immediate issues: Removed unnecessary ternary operator in RequestConfiguration
  • Updated build configuration: Added baseline to Docker build and package export ignores

Technical details

  • PHPStan runs at maximum strictness level to catch all possible issues
  • Baseline ensures CI passes while documenting technical debt
  • Configuration handles multiple Symfony versions (6.4 and 7.x) compatibility
  • Properly excludes test files, specs, and optional dependency code from analysis

@Rafikooo Rafikooo force-pushed the add-phpstan-to-ci branch 2 times, most recently from 978c31d to bb5dbd5 Compare October 27, 2025 12:34
@Rafikooo Rafikooo changed the title [CI] Add PHPStan to CI with level max [CI] Add PHPStan to CI Oct 27, 2025
@Rafikooo Rafikooo force-pushed the add-phpstan-to-ci branch 3 times, most recently from 2f9b472 to 4287efb Compare October 29, 2025 08:05
@GSadee GSadee added Maintenance Configurations, READMEs, releases, etc. dependencies Pull requests that update a dependency file labels Nov 4, 2025
@GSadee GSadee merged commit 6197587 into Sylius:1.14 Nov 4, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file Maintenance Configurations, READMEs, releases, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants