Skip to content

Bump PHPStan to level: max#47

Merged
turegjorup merged 1 commit into
developfrom
feature/phpstan-level-max
May 12, 2026
Merged

Bump PHPStan to level: max#47
turegjorup merged 1 commit into
developfrom
feature/phpstan-level-max

Conversation

@turegjorup
Copy link
Copy Markdown
Collaborator

Summary

Final one-line follow-up of the A → B → C series. The 5.0 PRs cleared every max-level PHPStan error in turn; this PR flips phpstan.neon from level: 8 to level: max so the strictest analysis level is locked in for future contributions.

- level: 8
+ level: max

How we got here

Effect going forward

Any future PR that reintroduces a mixed flow, an untyped array key access, a missing @throws, or any of the other strictness-rule violations now fails CI before review. The codebase is locked at PHPStan's highest level.

Test plan

  • task analyze:php at level: max — no errors.
  • task test:coverage — 100% on OpenIdConfigurationProvider (24/24 methods, 161/161 lines).
  • task lint:php — clean.
  • task lint:markdown — clean.
  • CI matrix on PR.

🤖 Generated with Claude Code

The 5.0 series of PRs cleared every max-level error in turn:

  - #43 typed the constructor `$options` / `$collaborators` array
    shapes (4 errors).
  - #42 + #44 narrowed JSON payload accesses and introduced
    `MetadataException` / `JwksException` for malformed IdP payloads
    (~9 errors).
  - #45 declared `getJwtVerificationKeys` as `array<string, Key>`,
    annotated `validateIdToken`'s `$claims` with a `\stdClass &
    object{aud, iss, nonce}` shape, and added Mockery overload
    `@var` annotations on every test mock (the remaining ~7
    errors).

With zero max-level errors remaining, this commit flips the one
line in `phpstan.neon`. Future contributions are now analyzed at
PHPStan's strictest level; any regression that reintroduces a
`mixed` flow will fail CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@turegjorup turegjorup self-assigned this May 12, 2026
@turegjorup turegjorup merged commit 810e141 into develop May 12, 2026
14 checks passed
@turegjorup turegjorup deleted the feature/phpstan-level-max branch May 12, 2026 11:02
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9f370c6) to head (ebfc625).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop       #47   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        71        71           
===========================================
  Files              1         1           
  Lines            185       185           
===========================================
  Hits             185       185           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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