Bump PHPStan to level: max#47
Merged
Merged
Conversation
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>
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.neonfromlevel: 8tolevel: maxso the strictest analysis level is locked in for future contributions.How we got here
$options/$collaboratorsarray shapes (4 errors).MetadataException/JwksExceptionfor malformed IdP payloads (~9 errors).getJwtVerificationKeysasarray<string, Key>, annotatedvalidateIdToken's$claimswith a\stdClass & object{aud, iss, nonce}shape, and added Mockery overload@varannotations on every test mock (the remaining ~7 errors).Effect going forward
Any future PR that reintroduces a
mixedflow, 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:phpatlevel: max— no errors.task test:coverage— 100% onOpenIdConfigurationProvider(24/24 methods, 161/161 lines).task lint:php— clean.task lint:markdown— clean.🤖 Generated with Claude Code