Skip to content

Commit

Permalink
fix(Database): Allow all Laravel 9 versions (Fix PHPStan warnings)
Browse files Browse the repository at this point in the history
By using reportUnmatched we can ignore ignored error on Laravel above 9.49 which adds @template support
  • Loading branch information
pionl committed Jun 9, 2023
1 parent 8f48750 commit 4d75907
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"require": {
"php": ">=8.1",
"laravel/framework": "^9.49.0",
"laravel/framework": "^9",
"psr/log": "^2 | ^3"
},
"require-dev": {
Expand Down
9 changes: 9 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ includes:
- phpstan-baseline.neon

parameters:
reportUnmatchedIgnoredErrors: true

parallel:
processTimeout: 600.0
Expand All @@ -24,3 +25,11 @@ parameters:
excludePaths:
- 'tests/Feature/Testing/Commands/MakeExpectationCommand/*.php'

ignoreErrors:
# CastsAttributes template was added in Laravel 9.49 (remove when we drop L9 support)
-
message: "#^PHPDoc tag @implements contains generic type Illuminate\\\\Contracts\\\\Database\\\\Eloquent\\\\CastsAttributes\\<float, float\\|int\\|string\\|null\\> but interface Illuminate\\\\Contracts\\\\Database\\\\Eloquent\\\\CastsAttributes is not generic\\.$#"
count: 1
path: src/Database/Models/Casts/FloatCast.php
reportUnmatched: false

0 comments on commit 4d75907

Please sign in to comment.