From ebfc625818b2b914551ee28b578f37d5cf17b74c Mon Sep 17 00:00:00 2001 From: turegjorup Date: Tue, 12 May 2026 12:58:36 +0200 Subject: [PATCH] Bump PHPStan to level: max 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`, 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) --- CHANGELOG.md | 7 +++++++ phpstan.neon | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7243863..07fd9be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -142,6 +142,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Tooling +- Bumped PHPStan from `level: 8` to `level: max` in `phpstan.neon`. + The preceding PRs in the 5.0 series (constructor option shapes, + JSON-payload narrowing, claim shape on `validateIdToken`, JWKS + validation, test-side Mockery / fixture / claim narrowings) cleared + every max-level error; the bump is the final one-line config + change that locks in the strictest analysis level for future + contributions. - `OpenIdConfigurationProvider::__construct` now declares an `array{cacheItemPool?: CacheItemPoolInterface, openIDConnectMetadataUrl?: string, cacheDuration?: int, leeway?: int, diff --git a/phpstan.neon b/phpstan.neon index 6e3ce04..c39bc0d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,7 +2,7 @@ includes: - vendor/phpstan/phpstan-mockery/extension.neon parameters: - level: 8 + level: max paths: - src - tests