We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 353716e commit aaa670cCopy full SHA for aaa670c
1 file changed
src/Analyser/MutatingScope.php
@@ -3228,12 +3228,13 @@ public function filterBySpecifiedTypes(SpecifiedTypes $specifiedTypes): self
3228
}
3229
3230
$guardType = $conditionalTypeHolder->getType();
3231
+ $specifiedType = $specifiedHolder->getType();
3232
if (
3233
$conditionalExpression->getTypeHolder()->getCertainty()->yes()
3234
&& $specifiedHolder->getCertainty()->yes()
3235
&& $conditionalTypeHolder->getCertainty()->yes()
- && $guardType->isScalar()->yes()
3236
- && $guardType->isSuperTypeOf($specifiedHolder->getType())->yes()
+ && ($guardType->isArray()->no())
3237
+ && $guardType->isSuperTypeOf($specifiedType)->yes()
3238
) {
3239
$subtypeMatch = true;
3240
continue;
0 commit comments