Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 23e5f37

Browse files
MartinMystikJonasondrejmirtes
authored andcommitted
Configuration option strictRules.disallowedLooseComparsion
1 parent 431b3d6 commit 23e5f37

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ You can disable rules using configuration parameters:
6262
```neon
6363
parameters:
6464
strictRules:
65+
disallowedLooseComparison: false
6566
booleansInConditions: false
6667
uselessCast: false
6768
requireParentConstructorCall: false

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"require": {
99
"php": "^7.2 || ^8.0",
10-
"phpstan/phpstan": "^1.8.3"
10+
"phpstan/phpstan": "^1.8.6"
1111
},
1212
"require-dev": {
1313
"nikic/php-parser": "^4.13.0",

‎rules.neon‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ parameters:
1616
illegalConstructorMethodCall: %featureToggles.bleedingEdge%
1717
strictRules:
1818
allRules: true
19+
disallowedLooseComparison: [%strictRules.allRules%, %featureToggles.bleedingEdge%]
1920
booleansInConditions: %strictRules.allRules%
2021
uselessCast: %strictRules.allRules%
2122
requireParentConstructorCall: %strictRules.allRules%
@@ -30,23 +31,24 @@ parameters:
3031

3132
parametersSchema:
3233
strictRules: structure([
33-
allRules: bool(),
34-
booleansInConditions: bool()
35-
uselessCast: bool()
36-
requireParentConstructorCall: bool()
37-
disallowedConstructs: bool()
38-
overwriteVariablesWithLoop: bool()
39-
closureUsesThis: bool()
40-
matchingInheritedMethodNames: bool()
41-
numericOperandsInArithmeticOperators: bool()
42-
strictCalls: bool()
43-
switchConditionsMatchingType: bool()
44-
noVariableVariables: bool()
34+
allRules: anyOf(bool(), arrayOf(bool())),
35+
disallowedLooseComparison: anyOf(bool(), arrayOf(bool())),
36+
booleansInConditions: anyOf(bool(), arrayOf(bool()))
37+
uselessCast: anyOf(bool(), arrayOf(bool()))
38+
requireParentConstructorCall: anyOf(bool(), arrayOf(bool()))
39+
disallowedConstructs: anyOf(bool(), arrayOf(bool()))
40+
overwriteVariablesWithLoop: anyOf(bool(), arrayOf(bool()))
41+
closureUsesThis: anyOf(bool(), arrayOf(bool()))
42+
matchingInheritedMethodNames: anyOf(bool(), arrayOf(bool()))
43+
numericOperandsInArithmeticOperators: anyOf(bool(), arrayOf(bool()))
44+
strictCalls: anyOf(bool(), arrayOf(bool()))
45+
switchConditionsMatchingType: anyOf(bool(), arrayOf(bool()))
46+
noVariableVariables: anyOf(bool(), arrayOf(bool()))
4547
])
4648

4749
conditionalTags:
4850
PHPStan\Rules\DisallowedConstructs\DisallowedLooseComparisonRule:
49-
phpstan.rules.rule: %featureToggles.bleedingEdge%
51+
phpstan.rules.rule: %strictRules.disallowedLooseComparison%
5052
PHPStan\Rules\BooleansInConditions\BooleanInBooleanAndRule:
5153
phpstan.rules.rule: %strictRules.booleansInConditions%
5254
PHPStan\Rules\BooleansInConditions\BooleanInBooleanNotRule:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /