PHPStan does not read phpstan.neon.dist
Problem/Motivation
When using the gitlab_templates PHPStan job in contrib projects, it
appears that only phpstan.neon is read. A common pattern for contrib
projects is to commit phpstan.neon.dist to the repository and let
local developers copy or override it as phpstan.neon.
In pipelines such as
project/resource_conflict/-/jobs/7295981 (and similarly in the Calendar module), the project provides phpstan.neon.dist but no
phpstan.neon. The PHPStan job still runs, but it seems to ignore
the phpstan.neon.dist and falls back to default configuration.
It is not clear whether this is an explicit design decision (only ever read
phpstan.neon) or an oversight. As a contrib maintainer, it would
be helpful either to support phpstan.neon.dist or to have the
expected behaviour documented.
Proposed resolution
- Confirm the intended behaviour of the PHPStan template with respect to
phpstan.neon.dist. - If supported, update the template so that:
- It prefers
phpstan.neonwhen present, but - Falls back to
phpstan.neon.distwhenphpstan.neonis missing.
- It prefers
- If
phpstan.neon.distis not meant to be supported, document that onlyphpstan.neonwill be loaded so contrib projects can adjust their config layout.
Remaining tasks
- Decide whether
phpstan.neon.distshould be supported by the template. - Update the PHPStan GitLab template to implement the chosen behaviour.
- Add or update documentation to describe how PHPStan configuration files are discovered in pipelines.
- (Optional) Add a small test or example project that demonstrates the supported pattern for contrib maintainers.