From 914b81371743dd816fe0abacd7f593e81233541a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Wed, 20 Mar 2024 17:36:23 +0800 Subject: [PATCH] When using `match` to match enum, the enumeration must be completely overwritten --- phpstan.neon.dist | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 6a22055..7a11543 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -15,3 +15,14 @@ parameters: ignoreErrors: - '#Static call to instance method Hyperf\\HttpServer\\Router\\Router::[a-zA-Z0-9\\_]+\(\)#' - '#Static call to instance method Hyperf\\DbConnection\\Db::[a-zA-Z0-9\\_]+\(\)#' + +services: + # When using `match` to match enum, the enumeration must be completely overwritten + - class: PHPStan\Rules\Comparison\MatchExpressionRule + arguments: + checkAlwaysTrueStrictComparison: %checkAlwaysTrueStrictComparison% + disableUnreachable: %featureToggles.disableUnreachableBranchesRules% + reportAlwaysTrueInLastCondition: %reportAlwaysTrueInLastCondition% + treatPhpDocTypesAsCertain: %treatPhpDocTypesAsCertain% + tags: + - phpstan.rules.rule