Skip to content

Commit

Permalink
[CodeQuality] Clean up ExplicitBoolCompareRector: remove unneeded che…
Browse files Browse the repository at this point in the history
…ck ConstantIntegerType (#1847)
  • Loading branch information
samsonasik committed Feb 20, 2022
1 parent ce15635 commit 59f6b29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rules/CodeQuality/Rector/If_/ExplicitBoolCompareRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use PhpParser\Node\Stmt\If_;
use PHPStan\Type\ArrayType;
use PHPStan\Type\BooleanType;
use PHPStan\Type\Constant\ConstantIntegerType;
use PHPStan\Type\FloatType;
use PHPStan\Type\IntegerType;
use PHPStan\Type\ObjectType;
Expand Down Expand Up @@ -114,7 +113,7 @@ public function refactor(Node $node): ?Node
}

$conditionStaticType = $this->getType($conditionNode);
if ($conditionStaticType instanceof BooleanType || $conditionStaticType instanceof ConstantIntegerType) {
if ($conditionStaticType instanceof BooleanType) {
return null;
}

Expand Down

0 comments on commit 59f6b29

Please sign in to comment.