Skip to content

Commit 23c263e

Browse files
committed
Fix CI failures [claude-ci-fix]
Automated fix attempt 1 for CI failures.
1 parent 4f29d70 commit 23c263e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Type/UnionType.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,22 @@ public function getUnresolvedMethodPrototype(string $methodName, ClassMemberAcce
584584
$prototype = $type->getUnresolvedMethodPrototype($methodName, $scope);
585585
if ($this instanceof TemplateType) {
586586
$prototype = $prototype->withCalledOnType($this);
587+
} else {
588+
$declaringClassType = new ObjectType($prototype->getNakedMethod()->getDeclaringClass()->getName());
589+
$typesForCalledOn = [];
590+
foreach ($this->types as $innerType) {
591+
if (!$innerType->hasMethod($methodName)->yes()) {
592+
continue;
593+
}
594+
if (!$declaringClassType->isSuperTypeOf($innerType)->yes()) {
595+
continue;
596+
}
597+
598+
$typesForCalledOn[] = $innerType;
599+
}
600+
if (count($typesForCalledOn) > 1) {
601+
$prototype = $prototype->withCalledOnType(TypeCombinator::union(...$typesForCalledOn));
602+
}
587603
}
588604
$methodPrototypes[] = $prototype;
589605
}

0 commit comments

Comments
 (0)