Skip to content

05: Static analysis in CI - #5

Open
nikolaystrikhar wants to merge 4 commits into
04-configfrom
05-ci-static-analysis
Open

05: Static analysis in CI#5
nikolaystrikhar wants to merge 4 commits into
04-configfrom
05-ci-static-analysis

Conversation

@nikolaystrikhar

@nikolaystrikhar nikolaystrikhar commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

PHPStan over src/, plus the workflow that runs it.

Stacked on #4 — this PR's diff is the two new files.

  • Level 8. The package analyses clean at 6, and 7 and 8 report the same single error, so 8 costs nothing beyond fixing that one. Level 9 is not taken: its five findings are all in Sub_Plugin's untyped config reads, which are the runtime guards treatPhpDocTypesAsCertain: false exists to keep.

- --ignore-platform-reqs also disabled the config.platform.php pin, which
  resolved dev dependencies requiring PHP 8.1+; waive only the ext-*
  requirements a static-analysis run genuinely has no use for.
- Run on 7.4, the floor the pin already targets, instead of an EOL 8.0 that
  matches neither end of the test matrix.
- Fail when src/ holds no PHP files: PHPStan 1.x exits 0 on nothing to
  analyse, so a moved source root would leave the check green forever.
- Narrow the token, cancel superseded PR runs, and cap the job, matching the
  tests workflow.
- Drop reportUnmatchedIgnoredErrors: false; with no ignores yet it does
  nothing except guarantee the first stale one never gets reported.
- Key the cache off head_ref, which is a branch name on pull_request.
Level 5 left coverage unused: the package analyses clean at 6, and 7 and 8
report the same single error, so 8 costs nothing beyond it. Level 9 is not
taken -- its five findings are all in Sub_Plugin's untyped config reads, which
are the runtime guards treatPhpDocTypesAsCertain: false exists to keep.
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