Skip to content

Commit 914b5e3

Browse files
committed
Everything from Bleeding Edge enabled
1 parent 988fab9 commit 914b5e3

17 files changed

+21
-69
lines changed

rules.neon

+5-21
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ parameters:
66
checkAlwaysTrueInstanceof: true
77
checkAlwaysTrueStrictComparison: true
88
checkAlwaysTrueLooseComparison: true
9-
checkDynamicProperties: %featureToggles.bleedingEdge%
9+
checkDynamicProperties: true
1010
checkExplicitMixedMissingReturn: true
1111
checkFunctionNameCase: true
1212
checkInternalClassCaseSensitivity: true
1313
reportMaybesInMethodSignatures: true
1414
reportStaticMethodSignatures: true
1515
reportMaybesInPropertyPhpDocTypes: true
16-
reportWrongPhpDocTypeInVarTag: %featureToggles.bleedingEdge%
16+
reportWrongPhpDocTypeInVarTag: true
1717
featureToggles:
18-
illegalConstructorMethodCall: %featureToggles.bleedingEdge%
18+
illegalConstructorMethodCall: true
1919
strictRules:
2020
allRules: true
21-
disallowedLooseComparison: [%strictRules.allRules%, %featureToggles.bleedingEdge%]
21+
disallowedLooseComparison: %strictRules.allRules%
2222
booleansInConditions: %strictRules.allRules%
2323
uselessCast: %strictRules.allRules%
2424
requireParentConstructorCall: %strictRules.allRules%
@@ -34,7 +34,7 @@ parameters:
3434
dynamicCallOnStaticMethod: %strictRules.allRules%
3535
switchConditionsMatchingType: %strictRules.allRules%
3636
noVariableVariables: %strictRules.allRules%
37-
strictArrayFilter: [%strictRules.allRules%, %featureToggles.bleedingEdge%]
37+
strictArrayFilter: %strictRules.allRules%
3838

3939
parametersSchema:
4040
strictRules: structure([
@@ -155,16 +155,12 @@ services:
155155

156156
-
157157
class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanAndRule
158-
arguments:
159-
bleedingEdge: %featureToggles.bleedingEdge%
160158

161159
-
162160
class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanNotRule
163161

164162
-
165163
class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanOrRule
166-
arguments:
167-
bleedingEdge: %featureToggles.bleedingEdge%
168164

169165
-
170166
class: PHPStan\Rules\BooleansInConditions\BooleanInElseIfConditionRule
@@ -229,33 +225,21 @@ services:
229225

230226
-
231227
class: PHPStan\Rules\Operators\OperandsInArithmeticAdditionRule
232-
arguments:
233-
bleedingEdge: %featureToggles.bleedingEdge%
234228

235229
-
236230
class: PHPStan\Rules\Operators\OperandsInArithmeticDivisionRule
237-
arguments:
238-
bleedingEdge: %featureToggles.bleedingEdge%
239231

240232
-
241233
class: PHPStan\Rules\Operators\OperandsInArithmeticExponentiationRule
242-
arguments:
243-
bleedingEdge: %featureToggles.bleedingEdge%
244234

245235
-
246236
class: PHPStan\Rules\Operators\OperandsInArithmeticModuloRule
247-
arguments:
248-
bleedingEdge: %featureToggles.bleedingEdge%
249237

250238
-
251239
class: PHPStan\Rules\Operators\OperandsInArithmeticMultiplicationRule
252-
arguments:
253-
bleedingEdge: %featureToggles.bleedingEdge%
254240

255241
-
256242
class: PHPStan\Rules\Operators\OperandsInArithmeticSubtractionRule
257-
arguments:
258-
bleedingEdge: %featureToggles.bleedingEdge%
259243

260244
-
261245
class: PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsRule

src/Rules/BooleansInConditions/BooleanInBooleanAndRule.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ class BooleanInBooleanAndRule implements Rule
1818

1919
private BooleanRuleHelper $helper;
2020

21-
private bool $bleedingEdge;
22-
23-
public function __construct(BooleanRuleHelper $helper, bool $bleedingEdge)
21+
public function __construct(BooleanRuleHelper $helper)
2422
{
2523
$this->helper = $helper;
26-
$this->bleedingEdge = $bleedingEdge;
2724
}
2825

2926
public function getNodeType(): string
@@ -35,7 +32,7 @@ public function processNode(Node $node, Scope $scope): array
3532
{
3633
$originalNode = $node->getOriginalNode();
3734
$messages = [];
38-
$nodeText = $this->bleedingEdge ? $originalNode->getOperatorSigil() : '&&';
35+
$nodeText = $originalNode->getOperatorSigil();
3936
$identifierType = $originalNode instanceof Node\Expr\BinaryOp\BooleanAnd ? 'booleanAnd' : 'logicalAnd';
4037
if (!$this->helper->passesAsBoolean($scope, $originalNode->left)) {
4138
$leftType = $scope->getType($originalNode->left);

src/Rules/BooleansInConditions/BooleanInBooleanOrRule.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ class BooleanInBooleanOrRule implements Rule
1818

1919
private BooleanRuleHelper $helper;
2020

21-
private bool $bleedingEdge;
22-
23-
public function __construct(BooleanRuleHelper $helper, bool $bleedingEdge)
21+
public function __construct(BooleanRuleHelper $helper)
2422
{
2523
$this->helper = $helper;
26-
$this->bleedingEdge = $bleedingEdge;
2724
}
2825

2926
public function getNodeType(): string
@@ -35,7 +32,7 @@ public function processNode(Node $node, Scope $scope): array
3532
{
3633
$originalNode = $node->getOriginalNode();
3734
$messages = [];
38-
$nodeText = $this->bleedingEdge ? $originalNode->getOperatorSigil() : '||';
35+
$nodeText = $originalNode->getOperatorSigil();
3936
$identifierType = $originalNode instanceof Node\Expr\BinaryOp\BooleanOr ? 'booleanOr' : 'logicalOr';
4037
if (!$this->helper->passesAsBoolean($scope, $originalNode->left)) {
4138
$leftType = $scope->getType($originalNode->left);

src/Rules/Operators/OperandsInArithmeticAdditionRule.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ class OperandsInArithmeticAdditionRule implements Rule
2121

2222
private OperatorRuleHelper $helper;
2323

24-
private bool $bleedingEdge;
25-
26-
public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge)
24+
public function __construct(OperatorRuleHelper $helper)
2725
{
2826
$this->helper = $helper;
29-
$this->bleedingEdge = $bleedingEdge;
3027
}
3128

3229
public function getNodeType(): string
@@ -39,7 +36,7 @@ public function processNode(Node $node, Scope $scope): array
3936
if ($node instanceof BinaryOpPlus) {
4037
$left = $node->left;
4138
$right = $node->right;
42-
} elseif ($node instanceof AssignOpPlus && $this->bleedingEdge) {
39+
} elseif ($node instanceof AssignOpPlus) {
4340
$left = $node->var;
4441
$right = $node->expr;
4542
} else {

src/Rules/Operators/OperandsInArithmeticDivisionRule.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ class OperandsInArithmeticDivisionRule implements Rule
2020

2121
private OperatorRuleHelper $helper;
2222

23-
private bool $bleedingEdge;
24-
25-
public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge)
23+
public function __construct(OperatorRuleHelper $helper)
2624
{
2725
$this->helper = $helper;
28-
$this->bleedingEdge = $bleedingEdge;
2926
}
3027

3128
public function getNodeType(): string
@@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
3835
if ($node instanceof BinaryOpDiv) {
3936
$left = $node->left;
4037
$right = $node->right;
41-
} elseif ($node instanceof AssignOpDiv && $this->bleedingEdge) {
38+
} elseif ($node instanceof AssignOpDiv) {
4239
$left = $node->var;
4340
$right = $node->expr;
4441
} else {

src/Rules/Operators/OperandsInArithmeticExponentiationRule.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ class OperandsInArithmeticExponentiationRule implements Rule
2020

2121
private OperatorRuleHelper $helper;
2222

23-
private bool $bleedingEdge;
24-
25-
public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge)
23+
public function __construct(OperatorRuleHelper $helper)
2624
{
2725
$this->helper = $helper;
28-
$this->bleedingEdge = $bleedingEdge;
2926
}
3027

3128
public function getNodeType(): string
@@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
3835
if ($node instanceof BinaryOpPow) {
3936
$left = $node->left;
4037
$right = $node->right;
41-
} elseif ($node instanceof AssignOpPow && $this->bleedingEdge) {
38+
} elseif ($node instanceof AssignOpPow) {
4239
$left = $node->var;
4340
$right = $node->expr;
4441
} else {

src/Rules/Operators/OperandsInArithmeticModuloRule.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ class OperandsInArithmeticModuloRule implements Rule
2020

2121
private OperatorRuleHelper $helper;
2222

23-
private bool $bleedingEdge;
24-
25-
public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge)
23+
public function __construct(OperatorRuleHelper $helper)
2624
{
2725
$this->helper = $helper;
28-
$this->bleedingEdge = $bleedingEdge;
2926
}
3027

3128
public function getNodeType(): string
@@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
3835
if ($node instanceof BinaryOpMod) {
3936
$left = $node->left;
4037
$right = $node->right;
41-
} elseif ($node instanceof AssignOpMod && $this->bleedingEdge) {
38+
} elseif ($node instanceof AssignOpMod) {
4239
$left = $node->var;
4340
$right = $node->expr;
4441
} else {

src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ class OperandsInArithmeticMultiplicationRule implements Rule
2020

2121
private OperatorRuleHelper $helper;
2222

23-
private bool $bleedingEdge;
24-
25-
public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge)
23+
public function __construct(OperatorRuleHelper $helper)
2624
{
2725
$this->helper = $helper;
28-
$this->bleedingEdge = $bleedingEdge;
2926
}
3027

3128
public function getNodeType(): string
@@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
3835
if ($node instanceof BinaryOpMul) {
3936
$left = $node->left;
4037
$right = $node->right;
41-
} elseif ($node instanceof AssignOpMul && $this->bleedingEdge) {
38+
} elseif ($node instanceof AssignOpMul) {
4239
$left = $node->var;
4340
$right = $node->expr;
4441
} else {

src/Rules/Operators/OperandsInArithmeticSubtractionRule.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ class OperandsInArithmeticSubtractionRule implements Rule
2020

2121
private OperatorRuleHelper $helper;
2222

23-
private bool $bleedingEdge;
24-
25-
public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge)
23+
public function __construct(OperatorRuleHelper $helper)
2624
{
2725
$this->helper = $helper;
28-
$this->bleedingEdge = $bleedingEdge;
2926
}
3027

3128
public function getNodeType(): string
@@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
3835
if ($node instanceof BinaryOpMinus) {
3936
$left = $node->left;
4037
$right = $node->right;
41-
} elseif ($node instanceof AssignOpMinus && $this->bleedingEdge) {
38+
} elseif ($node instanceof AssignOpMinus) {
4239
$left = $node->var;
4340
$right = $node->expr;
4441
} else {

tests/Rules/BooleansInConditions/BooleanInBooleanAndRuleTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected function getRule(): Rule
1818
new BooleanRuleHelper(
1919
self::getContainer()->getByType(RuleLevelHelper::class),
2020
),
21-
true,
2221
);
2322
}
2423

tests/Rules/BooleansInConditions/BooleanInBooleanOrRuleTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected function getRule(): Rule
1818
new BooleanRuleHelper(
1919
self::getContainer()->getByType(RuleLevelHelper::class),
2020
),
21-
true,
2221
);
2322
}
2423

tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ protected function getRule(): Rule
2020
new OperatorRuleHelper(
2121
self::getContainer()->getByType(RuleLevelHelper::class),
2222
),
23-
true,
2423
);
2524
}
2625

tests/Rules/Operators/OperandsInArithmeticDivisionRuleTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected function getRule(): Rule
1818
new OperatorRuleHelper(
1919
self::getContainer()->getByType(RuleLevelHelper::class),
2020
),
21-
true,
2221
);
2322
}
2423

tests/Rules/Operators/OperandsInArithmeticExponentiationRuleTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected function getRule(): Rule
1818
new OperatorRuleHelper(
1919
self::getContainer()->getByType(RuleLevelHelper::class),
2020
),
21-
true,
2221
);
2322
}
2423

tests/Rules/Operators/OperandsInArithmeticModuloRuleTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected function getRule(): Rule
1818
new OperatorRuleHelper(
1919
self::getContainer()->getByType(RuleLevelHelper::class),
2020
),
21-
true,
2221
);
2322
}
2423

tests/Rules/Operators/OperandsInArithmeticMultiplicationRuleTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected function getRule(): Rule
1818
new OperatorRuleHelper(
1919
self::getContainer()->getByType(RuleLevelHelper::class),
2020
),
21-
true,
2221
);
2322
}
2423

tests/Rules/Operators/OperandsInArithmeticSubtractionRuleTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected function getRule(): Rule
1818
new OperatorRuleHelper(
1919
self::getContainer()->getByType(RuleLevelHelper::class),
2020
),
21-
true,
2221
);
2322
}
2423

0 commit comments

Comments
 (0)