Skip to content

Commit 911712a

Browse files
authored
Prevent duplicate work
1 parent 7789962 commit 911712a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Rules/Comparison/ImpossibleCheckTypeHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function findSpecifiedType(
154154
foreach ($haystackArrayTypes as $haystackArrayType) {
155155
if ($haystackArrayType instanceof ConstantArrayType) {
156156
foreach ($haystackArrayType->getValueTypes() as $i => $haystackArrayValueType) {
157-
if (count($haystackArrayValueType->getFiniteTypes()) > 1 || $haystackArrayType->isOptionalKey($i)) {
157+
if ($haystackArrayType->isOptionalKey($i)) {
158158
continue;
159159
}
160160

@@ -163,7 +163,7 @@ public function findSpecifiedType(
163163
continue;
164164
}
165165

166-
foreach ($haystackArrayValueType->getConstantScalarTypes() as $constantScalarType) {
166+
foreach ($haystackArrayValueConstantScalarTypes as $constantScalarType) {
167167
if ($constantScalarType->isSuperTypeOf($needleType)->yes()) {
168168
continue 3;
169169
}

0 commit comments

Comments
 (0)