Skip to content

Commit cfd70d8

Browse files
committed
fixup! Replace error-prone instanceof in Rules classes
1 parent a743a3a commit cfd70d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Rules/Comparison/ConstantLooseComparisonRule.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PHPStan\Rules\Rule;
99
use PHPStan\Rules\RuleErrorBuilder;
1010
use PHPStan\Type\VerbosityLevel;
11+
use function in_array;
1112
use function sprintf;
1213

1314
/**
@@ -56,7 +57,7 @@ public function processNode(Node $node, Scope $scope): array
5657
return $ruleErrorBuilder->treatPhpDocTypesAsCertainTip();
5758
};
5859

59-
if ($nodeType->getConstantScalarValues()[0] === false) {
60+
if (in_array(false, $nodeType->getConstantScalarValues(), true)) {
6061
return [
6162
$addTip(RuleErrorBuilder::message(sprintf(
6263
'Loose comparison using %s between %s and %s will always evaluate to false.',

0 commit comments

Comments
 (0)