Skip to content

fix: reduce PHPStan baseline from 82 to 67 errors#818

Merged
Spomky merged 7 commits into5.3.xfrom
fix/reduce-phpstan-baseline-v3
Mar 22, 2026
Merged

fix: reduce PHPStan baseline from 82 to 67 errors#818
Spomky merged 7 commits into5.3.xfrom
fix/reduce-phpstan-baseline-v3

Conversation

@Spomky
Copy link
Copy Markdown
Contributor

@Spomky Spomky commented Mar 22, 2026

Summary

  • Reduce PHPStan baseline from 82 to 67 ignored errors (-15 errors, -138 lines) by fixing real type issues in the codebase
  • Add proper return type annotation on WebauthnCollector::getData()
  • Fix Psr18HttpClient anonymous class header types to match ResponseInterface covariance
  • Add @var string[] type assertion for x5c JWT header in FidoAllianceCompliantMetadataService
  • Uncomment 3rd parameter in PublicKeyCredentialCreationOptionsBuilder interface to match implementation
  • Initialize attestationStatementSupportManager in CompoundAttestationStatementSupport constructor
  • Make WebauthnBadge properties nullable with defaults and call parent UserBadge constructor
  • Widen Doctrine type convertToDatabaseValue() param to mixed with assert() for proper contravariance

Test plan

  • castor phpstan passes with no errors
  • Verify existing PHPUnit tests still pass
  • Verify no behavioral changes in WebauthnBadge getter methods (null check added alongside isResolved check)

🤖 Generated with Claude Code

@Spomky Spomky self-assigned this Mar 22, 2026
@Spomky Spomky added the DX Developer Experience label Mar 22, 2026
Spomky and others added 3 commits March 22, 2026 15:55
Rector correctly removed the redundant @var assertion — the @return
PHPDoc on getData() is sufficient.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rector strips inline @var on return statements. Using an intermediate
variable preserves the type narrowing that PHPStan needs (parent $data
is array|Data, not array<string, mixed>|Data).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Aligns test expectations with the ClientOverridePolicy default change
from 'required' to 'preferred' introduced in f0b0241.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Spomky Spomky merged commit f3b22ba into 5.3.x Mar 22, 2026
17 of 18 checks passed
@Spomky Spomky deleted the fix/reduce-phpstan-baseline-v3 branch March 22, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX Developer Experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant