Skip to content

Commit 1f1e916

Browse files
committed
fix(reflection): merge assertions in UnionTypeMethodReflection::getAsserts()
1 parent ab74f12 commit 1f1e916

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Reflection/Type/UnionTypeMethodReflection.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,13 @@ public function getDocComment(): ?string
177177

178178
public function getAsserts(): Assertions
179179
{
180-
return Assertions::createEmpty();
180+
$mergedAssertions = Assertions::createEmpty();
181+
182+
foreach ($this->methods as $method) {
183+
$mergedAssertions = $mergedAssertions->intersectWith($method->getAsserts());
184+
}
185+
186+
return $mergedAssertions;
181187
}
182188

183189
public function acceptsNamedArguments(): TrinaryLogic

0 commit comments

Comments
 (0)