Skip to content

Commit 537b6c7

Browse files
committed
Add toggles for backtick, empty, implicit array creation and short ternary
Fixes #248
1 parent daeec74 commit 537b6c7

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ parameters:
6767
uselessCast: false
6868
requireParentConstructorCall: false
6969
disallowedConstructs: false
70+
disallowedBacktick: false
71+
disallowedEmpty: false
72+
disallowedImplicitArrayCreation: false
73+
disallowedShortTernary: false
7074
overwriteVariablesWithLoop: false
7175
closureUsesThis: false
7276
matchingInheritedMethodNames: false

rules.neon

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ parameters:
2222
uselessCast: %strictRules.allRules%
2323
requireParentConstructorCall: %strictRules.allRules%
2424
disallowedConstructs: %strictRules.allRules%
25+
disallowedBacktick: %strictRules.allRules%
26+
disallowedEmpty: %strictRules.allRules%
27+
disallowedImplicitArrayCreation: %strictRules.allRules%
28+
disallowedShortTernary: %strictRules.allRules%
2529
overwriteVariablesWithLoop: %strictRules.allRules%
2630
closureUsesThis: %strictRules.allRules%
2731
matchingInheritedMethodNames: %strictRules.allRules%
@@ -39,6 +43,10 @@ parametersSchema:
3943
uselessCast: anyOf(bool(), arrayOf(bool()))
4044
requireParentConstructorCall: anyOf(bool(), arrayOf(bool()))
4145
disallowedConstructs: anyOf(bool(), arrayOf(bool()))
46+
disallowedBacktick: anyOf(bool(), arrayOf(bool()))
47+
disallowedEmpty: anyOf(bool(), arrayOf(bool()))
48+
disallowedImplicitArrayCreation: anyOf(bool(), arrayOf(bool()))
49+
disallowedShortTernary: anyOf(bool(), arrayOf(bool()))
4250
overwriteVariablesWithLoop: anyOf(bool(), arrayOf(bool()))
4351
closureUsesThis: anyOf(bool(), arrayOf(bool()))
4452
matchingInheritedMethodNames: anyOf(bool(), arrayOf(bool()))
@@ -69,13 +77,13 @@ conditionalTags:
6977
PHPStan\Rules\Classes\RequireParentConstructCallRule:
7078
phpstan.rules.rule: %strictRules.requireParentConstructorCall%
7179
PHPStan\Rules\DisallowedConstructs\DisallowedBacktickRule:
72-
phpstan.rules.rule: %strictRules.disallowedConstructs%
80+
phpstan.rules.rule: %strictRules.disallowedBacktick%
7381
PHPStan\Rules\DisallowedConstructs\DisallowedEmptyRule:
74-
phpstan.rules.rule: %strictRules.disallowedConstructs%
82+
phpstan.rules.rule: %strictRules.disallowedEmpty%
7583
PHPStan\Rules\DisallowedConstructs\DisallowedImplicitArrayCreationRule:
76-
phpstan.rules.rule: %strictRules.disallowedConstructs%
84+
phpstan.rules.rule: %strictRules.disallowedImplicitArrayCreation%
7785
PHPStan\Rules\DisallowedConstructs\DisallowedShortTernaryRule:
78-
phpstan.rules.rule: %strictRules.disallowedConstructs%
86+
phpstan.rules.rule: %strictRules.disallowedShortTernary%
7987
PHPStan\Rules\ForeachLoop\OverwriteVariablesWithForeachRule:
8088
phpstan.rules.rule: %strictRules.overwriteVariablesWithLoop%
8189
PHPStan\Rules\ForLoop\OverwriteVariablesWithForLoopInitRule:

0 commit comments

Comments
 (0)