We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getConstantArrays()
isConstantArray()
1 parent 93a5c26 commit a272969Copy full SHA for a272969
src/Rules/Comparison/ImpossibleCheckTypeHelper.php
@@ -87,13 +87,12 @@ public function findSpecifiedType(
87
return null;
88
}
89
90
- $constantArrays = $haystackType->getConstantArrays();
91
$needleType = $scope->getType($node->getArgs()[0]->value);
92
$valueType = $haystackType->getIterableValueType();
93
$constantNeedleTypesCount = count(TypeUtils::getConstantScalars($needleType));
94
$constantHaystackTypesCount = count(TypeUtils::getConstantScalars($valueType));
95
$isNeedleSupertype = $needleType->isSuperTypeOf($valueType);
96
- if (count($constantArrays) === 0) {
+ if ($haystackType->isConstantArray()->no()) {
97
if ($haystackType->isIterableAtLeastOnce()->yes()) {
98
if ($constantNeedleTypesCount === 1 && $constantHaystackTypesCount === 1) {
99
if ($isNeedleSupertype->yes()) {
0 commit comments