Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 31, 2023
1 parent 063a7fd commit a7ac762
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Rules/BooleansInConditions/BooleanRuleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use PhpParser\Node\Expr;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\RuleLevelHelper;
use PHPStan\Type\BooleanType;
use PHPStan\Type\ErrorType;
use PHPStan\Type\MixedType;
use PHPStan\Type\Type;
Expand All @@ -32,15 +31,15 @@ public function passesAsBoolean(Scope $scope, Expr $expr): bool
$expr,
'',
static function (Type $type): bool {
return $type instanceof BooleanType;
return $type->isBoolean()->yes();
}
);
$foundType = $typeToCheck->getType();
if ($foundType instanceof ErrorType) {
return true;
}

return $foundType instanceof BooleanType;
return $foundType->isBoolean()->yes();
}

}

0 comments on commit a7ac762

Please sign in to comment.