From 988fab9e77f55c851d478e1dd4880a00428d1a90 Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Tue, 24 Sep 2024 14:01:25 +0200 Subject: [PATCH] Add more separate rule toggles --- README.md | 8 ++++++-- rules.neon | 30 +++++++++++++++++++----------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9431011..835ecca 100644 --- a/README.md +++ b/README.md @@ -66,12 +66,16 @@ parameters: booleansInConditions: false uselessCast: false requireParentConstructorCall: false - disallowedConstructs: false + disallowedBacktick: false + disallowedEmpty: false + disallowedImplicitArrayCreation: false + disallowedShortTernary: false overwriteVariablesWithLoop: false closureUsesThis: false matchingInheritedMethodNames: false numericOperandsInArithmeticOperators: false - strictCalls: false + strictFunctionCalls: false + dynamicCallOnStaticMethod: false switchConditionsMatchingType: false noVariableVariables: false strictArrayFilter: false diff --git a/rules.neon b/rules.neon index 49b1a1f..c33efe5 100644 --- a/rules.neon +++ b/rules.neon @@ -22,12 +22,16 @@ parameters: booleansInConditions: %strictRules.allRules% uselessCast: %strictRules.allRules% requireParentConstructorCall: %strictRules.allRules% - disallowedConstructs: %strictRules.allRules% + disallowedBacktick: %strictRules.allRules% + disallowedEmpty: %strictRules.allRules% + disallowedImplicitArrayCreation: %strictRules.allRules% + disallowedShortTernary: %strictRules.allRules% overwriteVariablesWithLoop: %strictRules.allRules% closureUsesThis: %strictRules.allRules% matchingInheritedMethodNames: %strictRules.allRules% numericOperandsInArithmeticOperators: %strictRules.allRules% - strictCalls: %strictRules.allRules% + strictFunctionCalls: %strictRules.allRules% + dynamicCallOnStaticMethod: %strictRules.allRules% switchConditionsMatchingType: %strictRules.allRules% noVariableVariables: %strictRules.allRules% strictArrayFilter: [%strictRules.allRules%, %featureToggles.bleedingEdge%] @@ -39,12 +43,16 @@ parametersSchema: booleansInConditions: anyOf(bool(), arrayOf(bool())) uselessCast: anyOf(bool(), arrayOf(bool())) requireParentConstructorCall: anyOf(bool(), arrayOf(bool())) - disallowedConstructs: anyOf(bool(), arrayOf(bool())) + disallowedBacktick: anyOf(bool(), arrayOf(bool())) + disallowedEmpty: anyOf(bool(), arrayOf(bool())) + disallowedImplicitArrayCreation: anyOf(bool(), arrayOf(bool())) + disallowedShortTernary: anyOf(bool(), arrayOf(bool())) overwriteVariablesWithLoop: anyOf(bool(), arrayOf(bool())) closureUsesThis: anyOf(bool(), arrayOf(bool())) matchingInheritedMethodNames: anyOf(bool(), arrayOf(bool())) numericOperandsInArithmeticOperators: anyOf(bool(), arrayOf(bool())) - strictCalls: anyOf(bool(), arrayOf(bool())) + strictFunctionCalls: anyOf(bool(), arrayOf(bool())) + dynamicCallOnStaticMethod: anyOf(bool(), arrayOf(bool())) switchConditionsMatchingType: anyOf(bool(), arrayOf(bool())) noVariableVariables: anyOf(bool(), arrayOf(bool())) strictArrayFilter: anyOf(bool(), arrayOf(bool())) @@ -70,13 +78,13 @@ conditionalTags: PHPStan\Rules\Classes\RequireParentConstructCallRule: phpstan.rules.rule: %strictRules.requireParentConstructorCall% PHPStan\Rules\DisallowedConstructs\DisallowedBacktickRule: - phpstan.rules.rule: %strictRules.disallowedConstructs% + phpstan.rules.rule: %strictRules.disallowedBacktick% PHPStan\Rules\DisallowedConstructs\DisallowedEmptyRule: - phpstan.rules.rule: %strictRules.disallowedConstructs% + phpstan.rules.rule: %strictRules.disallowedEmpty% PHPStan\Rules\DisallowedConstructs\DisallowedImplicitArrayCreationRule: - phpstan.rules.rule: %strictRules.disallowedConstructs% + phpstan.rules.rule: %strictRules.disallowedImplicitArrayCreation% PHPStan\Rules\DisallowedConstructs\DisallowedShortTernaryRule: - phpstan.rules.rule: %strictRules.disallowedConstructs% + phpstan.rules.rule: %strictRules.disallowedShortTernary% PHPStan\Rules\ForeachLoop\OverwriteVariablesWithForeachRule: phpstan.rules.rule: %strictRules.overwriteVariablesWithLoop% PHPStan\Rules\ForLoop\OverwriteVariablesWithForLoopInitRule: @@ -108,11 +116,11 @@ conditionalTags: PHPStan\Rules\Operators\OperandsInArithmeticSubtractionRule: phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsRule: - phpstan.rules.rule: %strictRules.strictCalls% + phpstan.rules.rule: %strictRules.dynamicCallOnStaticMethod% PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsCallableRule: - phpstan.rules.rule: %strictRules.strictCalls% + phpstan.rules.rule: %strictRules.dynamicCallOnStaticMethod% PHPStan\Rules\StrictCalls\StrictFunctionCallsRule: - phpstan.rules.rule: %strictRules.strictCalls% + phpstan.rules.rule: %strictRules.strictFunctionCalls% PHPStan\Rules\SwitchConditions\MatchingTypeInSwitchCaseConditionRule: phpstan.rules.rule: %strictRules.switchConditionsMatchingType% PHPStan\Rules\VariableVariables\VariableMethodCallRule: