From 6abf9cff02bde04877799a7d8cb2e0d18b6351d2 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Wed, 3 Dec 2025 14:39:39 +0100 Subject: [PATCH] chore(tooling): improve phpstan config - update rules to the latest Larastan and PHPStan version - group rules with comments for easier updating in the future - reorder rules and includes --- phpstan.neon | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index b337bd036..d6b9d28fd 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,23 +1,30 @@ includes: - vendor/phpstan/phpstan/conf/bleedingEdge.neon + - vendor/phpstan/phpstan-strict-rules/rules.neon + - vendor/phpstan/phpstan-deprecation-rules/rules.neon - vendor/larastan/larastan/extension.neon - vendor/nesbot/carbon/extension.neon - - vendor/phpstan/phpstan-deprecation-rules/rules.neon - - vendor/phpstan/phpstan-strict-rules/rules.neon parameters: level: max - checkModelProperties: true - checkOctaneCompatibility: true - checkMissingCallableSignature: true + + # Additional Core PHPStan Rules checkTooWideReturnTypesInProtectedAndPublicMethods: true - rememberPossiblyImpureFunctionValues: false checkBenevolentUnionTypes: true reportPossiblyNonexistentGeneralArrayOffset: true reportPossiblyNonexistentConstantArrayOffset: true - reportAlwaysTrueInLastCondition: true reportAnyTypeWideningInVarTag: true + checkMissingCallableSignature: true tipsOfTheDay: false + + # Additional Larastan Rules + noUnnecessaryEnumerableToArrayCalls: true + checkModelProperties: true + checkOctaneCompatibility: true + checkModelMethodVisibility: true + checkAuthCallsWhenInRequestScope: true + checkConfigTypes: true + tmpDir: ./storage/phpstan paths: - app @@ -32,4 +39,4 @@ parameters: strictRules: strictArrayFilter: false ignoreErrors: - - '#Dynamic call to static method Illuminate\\Http\\Request::validate\(\)#' + # - '#Dynamic call to static method Illuminate\\Http\\Request::validate\(\)#'