Skip to content

Commit a272969

Browse files
herndlmondrejmirtes
authored andcommitted
Replace single getConstantArrays() usage with isConstantArray()
1 parent 93a5c26 commit a272969

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Rules/Comparison/ImpossibleCheckTypeHelper.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,12 @@ public function findSpecifiedType(
8787
return null;
8888
}
8989

90-
$constantArrays = $haystackType->getConstantArrays();
9190
$needleType = $scope->getType($node->getArgs()[0]->value);
9291
$valueType = $haystackType->getIterableValueType();
9392
$constantNeedleTypesCount = count(TypeUtils::getConstantScalars($needleType));
9493
$constantHaystackTypesCount = count(TypeUtils::getConstantScalars($valueType));
9594
$isNeedleSupertype = $needleType->isSuperTypeOf($valueType);
96-
if (count($constantArrays) === 0) {
95+
if ($haystackType->isConstantArray()->no()) {
9796
if ($haystackType->isIterableAtLeastOnce()->yes()) {
9897
if ($constantNeedleTypesCount === 1 && $constantHaystackTypesCount === 1) {
9998
if ($isNeedleSupertype->yes()) {

0 commit comments

Comments
 (0)