diff --git a/rules.neon b/rules.neon index c33efe5..fad3a2f 100644 --- a/rules.neon +++ b/rules.neon @@ -6,19 +6,19 @@ parameters: checkAlwaysTrueInstanceof: true checkAlwaysTrueStrictComparison: true checkAlwaysTrueLooseComparison: true - checkDynamicProperties: %featureToggles.bleedingEdge% + checkDynamicProperties: true checkExplicitMixedMissingReturn: true checkFunctionNameCase: true checkInternalClassCaseSensitivity: true reportMaybesInMethodSignatures: true reportStaticMethodSignatures: true reportMaybesInPropertyPhpDocTypes: true - reportWrongPhpDocTypeInVarTag: %featureToggles.bleedingEdge% + reportWrongPhpDocTypeInVarTag: true featureToggles: - illegalConstructorMethodCall: %featureToggles.bleedingEdge% + illegalConstructorMethodCall: true strictRules: allRules: true - disallowedLooseComparison: [%strictRules.allRules%, %featureToggles.bleedingEdge%] + disallowedLooseComparison: %strictRules.allRules% booleansInConditions: %strictRules.allRules% uselessCast: %strictRules.allRules% requireParentConstructorCall: %strictRules.allRules% @@ -34,7 +34,7 @@ parameters: dynamicCallOnStaticMethod: %strictRules.allRules% switchConditionsMatchingType: %strictRules.allRules% noVariableVariables: %strictRules.allRules% - strictArrayFilter: [%strictRules.allRules%, %featureToggles.bleedingEdge%] + strictArrayFilter: %strictRules.allRules% parametersSchema: strictRules: structure([ @@ -155,16 +155,12 @@ services: - class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanAndRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanNotRule - class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanOrRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - class: PHPStan\Rules\BooleansInConditions\BooleanInElseIfConditionRule @@ -229,33 +225,21 @@ services: - class: PHPStan\Rules\Operators\OperandsInArithmeticAdditionRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - class: PHPStan\Rules\Operators\OperandsInArithmeticDivisionRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - class: PHPStan\Rules\Operators\OperandsInArithmeticExponentiationRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - class: PHPStan\Rules\Operators\OperandsInArithmeticModuloRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - class: PHPStan\Rules\Operators\OperandsInArithmeticMultiplicationRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - class: PHPStan\Rules\Operators\OperandsInArithmeticSubtractionRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - class: PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsRule diff --git a/src/Rules/BooleansInConditions/BooleanInBooleanAndRule.php b/src/Rules/BooleansInConditions/BooleanInBooleanAndRule.php index a305569..eed19ae 100644 --- a/src/Rules/BooleansInConditions/BooleanInBooleanAndRule.php +++ b/src/Rules/BooleansInConditions/BooleanInBooleanAndRule.php @@ -18,12 +18,9 @@ class BooleanInBooleanAndRule implements Rule private BooleanRuleHelper $helper; - private bool $bleedingEdge; - - public function __construct(BooleanRuleHelper $helper, bool $bleedingEdge) + public function __construct(BooleanRuleHelper $helper) { $this->helper = $helper; - $this->bleedingEdge = $bleedingEdge; } public function getNodeType(): string @@ -35,7 +32,7 @@ public function processNode(Node $node, Scope $scope): array { $originalNode = $node->getOriginalNode(); $messages = []; - $nodeText = $this->bleedingEdge ? $originalNode->getOperatorSigil() : '&&'; + $nodeText = $originalNode->getOperatorSigil(); $identifierType = $originalNode instanceof Node\Expr\BinaryOp\BooleanAnd ? 'booleanAnd' : 'logicalAnd'; if (!$this->helper->passesAsBoolean($scope, $originalNode->left)) { $leftType = $scope->getType($originalNode->left); diff --git a/src/Rules/BooleansInConditions/BooleanInBooleanOrRule.php b/src/Rules/BooleansInConditions/BooleanInBooleanOrRule.php index d0b91dd..cb06a34 100644 --- a/src/Rules/BooleansInConditions/BooleanInBooleanOrRule.php +++ b/src/Rules/BooleansInConditions/BooleanInBooleanOrRule.php @@ -18,12 +18,9 @@ class BooleanInBooleanOrRule implements Rule private BooleanRuleHelper $helper; - private bool $bleedingEdge; - - public function __construct(BooleanRuleHelper $helper, bool $bleedingEdge) + public function __construct(BooleanRuleHelper $helper) { $this->helper = $helper; - $this->bleedingEdge = $bleedingEdge; } public function getNodeType(): string @@ -35,7 +32,7 @@ public function processNode(Node $node, Scope $scope): array { $originalNode = $node->getOriginalNode(); $messages = []; - $nodeText = $this->bleedingEdge ? $originalNode->getOperatorSigil() : '||'; + $nodeText = $originalNode->getOperatorSigil(); $identifierType = $originalNode instanceof Node\Expr\BinaryOp\BooleanOr ? 'booleanOr' : 'logicalOr'; if (!$this->helper->passesAsBoolean($scope, $originalNode->left)) { $leftType = $scope->getType($originalNode->left); diff --git a/src/Rules/Operators/OperandsInArithmeticAdditionRule.php b/src/Rules/Operators/OperandsInArithmeticAdditionRule.php index fd4b119..80de146 100644 --- a/src/Rules/Operators/OperandsInArithmeticAdditionRule.php +++ b/src/Rules/Operators/OperandsInArithmeticAdditionRule.php @@ -21,12 +21,9 @@ class OperandsInArithmeticAdditionRule implements Rule private OperatorRuleHelper $helper; - private bool $bleedingEdge; - - public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge) + public function __construct(OperatorRuleHelper $helper) { $this->helper = $helper; - $this->bleedingEdge = $bleedingEdge; } public function getNodeType(): string @@ -39,7 +36,7 @@ public function processNode(Node $node, Scope $scope): array if ($node instanceof BinaryOpPlus) { $left = $node->left; $right = $node->right; - } elseif ($node instanceof AssignOpPlus && $this->bleedingEdge) { + } elseif ($node instanceof AssignOpPlus) { $left = $node->var; $right = $node->expr; } else { diff --git a/src/Rules/Operators/OperandsInArithmeticDivisionRule.php b/src/Rules/Operators/OperandsInArithmeticDivisionRule.php index 642d6e8..e95b3d6 100644 --- a/src/Rules/Operators/OperandsInArithmeticDivisionRule.php +++ b/src/Rules/Operators/OperandsInArithmeticDivisionRule.php @@ -20,12 +20,9 @@ class OperandsInArithmeticDivisionRule implements Rule private OperatorRuleHelper $helper; - private bool $bleedingEdge; - - public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge) + public function __construct(OperatorRuleHelper $helper) { $this->helper = $helper; - $this->bleedingEdge = $bleedingEdge; } public function getNodeType(): string @@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array if ($node instanceof BinaryOpDiv) { $left = $node->left; $right = $node->right; - } elseif ($node instanceof AssignOpDiv && $this->bleedingEdge) { + } elseif ($node instanceof AssignOpDiv) { $left = $node->var; $right = $node->expr; } else { diff --git a/src/Rules/Operators/OperandsInArithmeticExponentiationRule.php b/src/Rules/Operators/OperandsInArithmeticExponentiationRule.php index 128194c..1992b84 100644 --- a/src/Rules/Operators/OperandsInArithmeticExponentiationRule.php +++ b/src/Rules/Operators/OperandsInArithmeticExponentiationRule.php @@ -20,12 +20,9 @@ class OperandsInArithmeticExponentiationRule implements Rule private OperatorRuleHelper $helper; - private bool $bleedingEdge; - - public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge) + public function __construct(OperatorRuleHelper $helper) { $this->helper = $helper; - $this->bleedingEdge = $bleedingEdge; } public function getNodeType(): string @@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array if ($node instanceof BinaryOpPow) { $left = $node->left; $right = $node->right; - } elseif ($node instanceof AssignOpPow && $this->bleedingEdge) { + } elseif ($node instanceof AssignOpPow) { $left = $node->var; $right = $node->expr; } else { diff --git a/src/Rules/Operators/OperandsInArithmeticModuloRule.php b/src/Rules/Operators/OperandsInArithmeticModuloRule.php index a687c05..5b5f3c3 100644 --- a/src/Rules/Operators/OperandsInArithmeticModuloRule.php +++ b/src/Rules/Operators/OperandsInArithmeticModuloRule.php @@ -20,12 +20,9 @@ class OperandsInArithmeticModuloRule implements Rule private OperatorRuleHelper $helper; - private bool $bleedingEdge; - - public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge) + public function __construct(OperatorRuleHelper $helper) { $this->helper = $helper; - $this->bleedingEdge = $bleedingEdge; } public function getNodeType(): string @@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array if ($node instanceof BinaryOpMod) { $left = $node->left; $right = $node->right; - } elseif ($node instanceof AssignOpMod && $this->bleedingEdge) { + } elseif ($node instanceof AssignOpMod) { $left = $node->var; $right = $node->expr; } else { diff --git a/src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php b/src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php index e7e055b..353df4c 100644 --- a/src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php +++ b/src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php @@ -20,12 +20,9 @@ class OperandsInArithmeticMultiplicationRule implements Rule private OperatorRuleHelper $helper; - private bool $bleedingEdge; - - public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge) + public function __construct(OperatorRuleHelper $helper) { $this->helper = $helper; - $this->bleedingEdge = $bleedingEdge; } public function getNodeType(): string @@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array if ($node instanceof BinaryOpMul) { $left = $node->left; $right = $node->right; - } elseif ($node instanceof AssignOpMul && $this->bleedingEdge) { + } elseif ($node instanceof AssignOpMul) { $left = $node->var; $right = $node->expr; } else { diff --git a/src/Rules/Operators/OperandsInArithmeticSubtractionRule.php b/src/Rules/Operators/OperandsInArithmeticSubtractionRule.php index 527f645..5559d60 100644 --- a/src/Rules/Operators/OperandsInArithmeticSubtractionRule.php +++ b/src/Rules/Operators/OperandsInArithmeticSubtractionRule.php @@ -20,12 +20,9 @@ class OperandsInArithmeticSubtractionRule implements Rule private OperatorRuleHelper $helper; - private bool $bleedingEdge; - - public function __construct(OperatorRuleHelper $helper, bool $bleedingEdge) + public function __construct(OperatorRuleHelper $helper) { $this->helper = $helper; - $this->bleedingEdge = $bleedingEdge; } public function getNodeType(): string @@ -38,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array if ($node instanceof BinaryOpMinus) { $left = $node->left; $right = $node->right; - } elseif ($node instanceof AssignOpMinus && $this->bleedingEdge) { + } elseif ($node instanceof AssignOpMinus) { $left = $node->var; $right = $node->expr; } else { diff --git a/tests/Rules/BooleansInConditions/BooleanInBooleanAndRuleTest.php b/tests/Rules/BooleansInConditions/BooleanInBooleanAndRuleTest.php index 08625e6..ab030c5 100644 --- a/tests/Rules/BooleansInConditions/BooleanInBooleanAndRuleTest.php +++ b/tests/Rules/BooleansInConditions/BooleanInBooleanAndRuleTest.php @@ -18,7 +18,6 @@ protected function getRule(): Rule new BooleanRuleHelper( self::getContainer()->getByType(RuleLevelHelper::class), ), - true, ); } diff --git a/tests/Rules/BooleansInConditions/BooleanInBooleanOrRuleTest.php b/tests/Rules/BooleansInConditions/BooleanInBooleanOrRuleTest.php index feb8186..5e3e83a 100644 --- a/tests/Rules/BooleansInConditions/BooleanInBooleanOrRuleTest.php +++ b/tests/Rules/BooleansInConditions/BooleanInBooleanOrRuleTest.php @@ -18,7 +18,6 @@ protected function getRule(): Rule new BooleanRuleHelper( self::getContainer()->getByType(RuleLevelHelper::class), ), - true, ); } diff --git a/tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php b/tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php index 6d1383f..f1bec0e 100644 --- a/tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php +++ b/tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php @@ -20,7 +20,6 @@ protected function getRule(): Rule new OperatorRuleHelper( self::getContainer()->getByType(RuleLevelHelper::class), ), - true, ); } diff --git a/tests/Rules/Operators/OperandsInArithmeticDivisionRuleTest.php b/tests/Rules/Operators/OperandsInArithmeticDivisionRuleTest.php index 6f059fc..5714808 100644 --- a/tests/Rules/Operators/OperandsInArithmeticDivisionRuleTest.php +++ b/tests/Rules/Operators/OperandsInArithmeticDivisionRuleTest.php @@ -18,7 +18,6 @@ protected function getRule(): Rule new OperatorRuleHelper( self::getContainer()->getByType(RuleLevelHelper::class), ), - true, ); } diff --git a/tests/Rules/Operators/OperandsInArithmeticExponentiationRuleTest.php b/tests/Rules/Operators/OperandsInArithmeticExponentiationRuleTest.php index 2d7681d..539a969 100644 --- a/tests/Rules/Operators/OperandsInArithmeticExponentiationRuleTest.php +++ b/tests/Rules/Operators/OperandsInArithmeticExponentiationRuleTest.php @@ -18,7 +18,6 @@ protected function getRule(): Rule new OperatorRuleHelper( self::getContainer()->getByType(RuleLevelHelper::class), ), - true, ); } diff --git a/tests/Rules/Operators/OperandsInArithmeticModuloRuleTest.php b/tests/Rules/Operators/OperandsInArithmeticModuloRuleTest.php index da766ca..54ccc48 100644 --- a/tests/Rules/Operators/OperandsInArithmeticModuloRuleTest.php +++ b/tests/Rules/Operators/OperandsInArithmeticModuloRuleTest.php @@ -18,7 +18,6 @@ protected function getRule(): Rule new OperatorRuleHelper( self::getContainer()->getByType(RuleLevelHelper::class), ), - true, ); } diff --git a/tests/Rules/Operators/OperandsInArithmeticMultiplicationRuleTest.php b/tests/Rules/Operators/OperandsInArithmeticMultiplicationRuleTest.php index 7a1e62e..4864120 100644 --- a/tests/Rules/Operators/OperandsInArithmeticMultiplicationRuleTest.php +++ b/tests/Rules/Operators/OperandsInArithmeticMultiplicationRuleTest.php @@ -18,7 +18,6 @@ protected function getRule(): Rule new OperatorRuleHelper( self::getContainer()->getByType(RuleLevelHelper::class), ), - true, ); } diff --git a/tests/Rules/Operators/OperandsInArithmeticSubtractionRuleTest.php b/tests/Rules/Operators/OperandsInArithmeticSubtractionRuleTest.php index b6ea825..66dc3b0 100644 --- a/tests/Rules/Operators/OperandsInArithmeticSubtractionRuleTest.php +++ b/tests/Rules/Operators/OperandsInArithmeticSubtractionRuleTest.php @@ -18,7 +18,6 @@ protected function getRule(): Rule new OperatorRuleHelper( self::getContainer()->getByType(RuleLevelHelper::class), ), - true, ); }