Skip to content

Commit

Permalink
Instead of AccessoryArrayListType::intersectWith($type), do TypeCombi…
Browse files Browse the repository at this point in the history
…nator::intersect($type, new AccessoryArrayListType()).
  • Loading branch information
staabm committed Nov 14, 2024
1 parent 43d423d commit 6f883c8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private function reduceResultType(MethodReflection $methodReflection, Type $resu
if ('fetch' === $methodName) {
return TypeCombinator::addNull($resultType);
} elseif ('fetchAll' === $methodName) {
return AccessoryArrayListType::intersectWith(new ArrayType(new IntegerType(), $resultType));
return TypeCombinator::intersect(new ArrayType(new IntegerType(), $resultType), new AccessoryArrayListType());
} elseif ('fetchPairs' === $methodName && $resultType instanceof ConstantArrayType && 2 === \count($resultType->getValueTypes())) {
return new ArrayType($resultType->getValueTypes()[0], $resultType->getValueTypes()[1]);
} elseif ('fetchSingle' === $methodName && $resultType instanceof ConstantArrayType && 1 === \count($resultType->getValueTypes())) {
Expand Down

0 comments on commit 6f883c8

Please sign in to comment.