Skip to content

Comments

chore: increase PHPStan level#68

Merged
dxnter merged 2 commits intomainfrom
chore/increase-phpstan-level
Feb 23, 2026
Merged

chore: increase PHPStan level#68
dxnter merged 2 commits intomainfrom
chore/increase-phpstan-level

Conversation

@dxnter
Copy link
Member

@dxnter dxnter commented Feb 23, 2026

Updates PHPStan from level 5 to level 6 as the default configuration. This improves type safety and IDE autocompletion across the starter.

What Changed

  • Added missing return type declarations, parameter types, and @var/@param/@return annotations throughout the codebase
  • Fixed array<int, T> vs list<T> mismatches

The starter now ships at level 6 with zero errors. Levels 7 and 8 were tested during development and many issues were resolved proactively, but some remain:

  • Level 7: Mostly Builder::where('column') string literal warnings from Larastan's model property checking, and Filament internals
  • Level 8: Dominated by auth()->user() returning User|null behind auth middleware, and Filament's generic $this-record type

These are framework false positives rather than real bugs. Teams targeting level 7+ should either address the remaining errors or generate a PHPStan baseline.

@github-actions
Copy link

πŸ“Š PHPUnit Test Results

598 tests   598 βœ”οΈβ€ƒβ€ƒ1m 28s ⏱️
βŸβ€„80 suitesβ€ƒβ€ƒβŸβ€„βŸβ€„0 πŸ’€
βŸβ€„βŸβ€„3 filesβ€„β€‚β€ƒβ€ƒβŸβ€„βŸβ€„0 ❌

Results for commit bc9e7a3.

@github-actions
Copy link

Test Results

passed 13 passed

Details

tests 13 tests
clock 35.9s
tool cypress
app Northwestern Laravel Starter
build Check PR arrow-right end-to-end-tests link #146
pull-request chore: increase PHPStan level link #68

Github Test Reporter by CTRF πŸ’š

@dxnter dxnter merged commit d281454 into main Feb 23, 2026
10 checks passed
@dxnter dxnter deleted the chore/increase-phpstan-level branch February 23, 2026 19:11
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