Skip to content

docs: document PHPStan 2.x and Larastan 3.x upgrade changes - #503

Merged
imorland merged 1 commit into
mainfrom
im/phpstan-2-docs
Feb 25, 2026
Merged

docs: document PHPStan 2.x and Larastan 3.x upgrade changes#503
imorland merged 1 commit into
mainfrom
im/phpstan-2-docs

Conversation

@imorland

Copy link
Copy Markdown
Member

Summary

  • Adds a new ### PHPStan / Larastan section to the 2.x upgrade guide (update-2_0.md) under Infrastructure, covering:
    • Version bumps: PHPStan ^1.10 → ^2.1, Larastan 2.9 → ^3.8
    • Recommended level increase to 6 (matching Flarum core)
    • Removed phpstan.neon parameters that will error if left in (checkMissingIterableValueType, checkGenericClassInNonGenericObjectType, and the always-true check parameters)
    • Larastan 3.x breaking change: explicit generic annotations now required on Eloquent relation methods, with before/after code example and link to the Rector migration rule
    • Larastan 3.x template annotation renames (TModelClassTModel, TChildModelTDeclaringModel)
  • Updates static-code-analysis.md setup guide:
    • Bumps recommended level from 5 to 6
    • Removes stale # The level will be increased in Flarum 2.0 comment
    • Removes checkMissingIterableValueType: false from the example config (parameter no longer exists in PHPStan 2.x and would cause an error)

Test plan

🤖 Generated with Claude Code

Adds a detailed PHPStan/Larastan section to the 2.x upgrade guide covering
the version bumps, recommended level 6 increase, removed config parameters,
and Larastan 3.x breaking changes (explicit relation generics, annotation
renames). Updates the static-code-analysis setup guide to reflect level 6
and remove the now-invalid checkMissingIterableValueType parameter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imorland
imorland merged commit 8c93f7b into main Feb 25, 2026
1 check passed
@imorland
imorland deleted the im/phpstan-2-docs branch February 25, 2026 16:30
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