Steps to reproduce
- Project with extensions in
custom/plugins/ and custom/static-plugins/
- Add a
phpstan.neon to the project root:
parameters:
level: 6
paths:
- custom/static-plugins
excludePaths:
analyseAndScan:
- custom/plugins/Swag*
analyse:
- vendor
- Run:
shopware-cli project validate . --local-only --only=phpstan --reporter=json
Expected behavior
PHPStan respects the local neon config. Extensions matching excludePaths are excluded from analysis without errors.
Actual behavior
PHPStan seems to be invoked per source directory with the directory as a CLI argument, which overrides the neon's paths. When a source directory (e.g. SwagPlatformDemoData/src) matches excludePaths, PHPStan
finds no files to analyse and the output fails to unmarshal at https://github.com/shopware/shopware-cli/blob/main/internal/verifier/phpstan.go#L91.
Workaround
Use ignore_extensions in .shopware-project.yml
