Skip to content

Commit 4313dec

Browse files
committed
Improvement to a better way
1 parent 26193be commit 4313dec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Rules/Comparison/ImpossibleCheckTypeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function findSpecifiedType(
153153
foreach ($haystackArrayTypes as $haystackArrayType) {
154154
if ($haystackArrayType instanceof ConstantArrayType) {
155155
foreach ($haystackArrayType->getValueTypes() as $i => $haystackArrayValueType) {
156-
if ($haystackArrayValueType instanceof UnionType || $haystackArrayType->isOptionalKey($i)) {
156+
if (count($haystackArrayValueType->getFiniteTypes()) > 1 || $haystackArrayType->isOptionalKey($i)) {
157157
continue;
158158
}
159159

0 commit comments

Comments
 (0)