We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e25e29e commit 142dc2fCopy full SHA for 142dc2f
src/Type/Constant/ConstantArrayType.php
@@ -405,10 +405,12 @@ public function isSuperTypeOf(Type $type): TrinaryLogic
405
return $result;
406
}
407
408
- return $result->and(
409
- $this->getKeyType()->isSuperTypeOf($type->getKeyType()),
410
- $this->getItemType()->isSuperTypeOf($type->getItemType()),
411
- );
+ $isKeySuperType = $this->getKeyType()->isSuperTypeOf($type->getKeyType());
+ if ($isKeySuperType->no()) {
+ return TrinaryLogic::createNo();
+ }
412
+
413
+ return $result->and($isKeySuperType, $this->getItemType()->isSuperTypeOf($type->getItemType()));
414
415
416
if ($type instanceof CompoundType) {
0 commit comments