Skip to content

Commit

Permalink
Revert "Find unnecessary ternary operators"
Browse files Browse the repository at this point in the history
This reverts commit c5fa47c.
  • Loading branch information
ondrejmirtes committed Dec 13, 2020
1 parent 80a77d3 commit 03807e3
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 103 deletions.
5 changes: 0 additions & 5 deletions rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,10 @@ rules:
- PHPStan\Rules\VariableVariables\VariableVariablesRule

conditionalTags:
PHPStan\Rules\Operators\OperandsInTernaryOperatorRule:
phpstan.rules.rule: %featureToggles.bleedingEdge%
PHPStan\Rules\ForLoop\OverwriteVariablesWithForLoopInitRule:
phpstan.rules.rule: %featureToggles.bleedingEdge%

services:
-
class: PHPStan\Rules\Operators\OperandsInTernaryOperatorRule

-
class: PHPStan\Rules\BooleansInConditions\BooleanRuleHelper

Expand Down
39 changes: 0 additions & 39 deletions src/Rules/Operators/OperandsInTernaryOperatorRule.php

This file was deleted.

44 changes: 0 additions & 44 deletions tests/Rules/Operators/OperandsInTernaryOperatorRuleTest.php

This file was deleted.

15 changes: 0 additions & 15 deletions tests/Rules/Operators/data/operators.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,3 @@ function (array $array, int $int, $mixed) {

explode($mixed, $mixed) + $int;
};

foo() ? true : true;
foo() ? true : null;
foo() ? $object : true;
foo() ? $object : false;
foo() ? $object : null;
foo() ? [] : [];
foo() ? 'string_val' : 'string_val';
foo() ? [23, 24] : [23, 25];
foo() ? [23, 24] : [23, 24];
foo() ? [1 => 1] : ['1' => 1];
foo() ? [1 => 1] : ['asd' => 1];
$object ?: $object;
foo() ? false : true;
foo() ? true : false;

0 comments on commit 03807e3

Please sign in to comment.