Skip to content

Commit 083e425

Browse files
union and intersection
1 parent d843b7b commit 083e425

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Reflection/Type/IntersectionTypeMethodReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,9 @@ public function getAttributes(): array
228228
return $this->methods[0]->getAttributes();
229229
}
230230

231+
public function hasNoDiscardAttribute(): TrinaryLogic
232+
{
233+
return TrinaryLogic::lazyMaxMin($this->methods, static fn (ExtendedMethodReflection $method): TrinaryLogic => $method->hasNoDiscardAttribute());
234+
}
235+
231236
}

src/Reflection/Type/UnionTypeMethodReflection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,8 @@ public function getAttributes(): array
205205
return $this->methods[0]->getAttributes();
206206
}
207207

208+
public function hasNoDiscardAttribute(): TrinaryLogic
209+
{
210+
return TrinaryLogic::lazyExtremeIdentity($this->methods, static fn (ExtendedMethodReflection $method): TrinaryLogic => $method->hasNoDiscardAttribute());
211+
}
208212
}

0 commit comments

Comments
 (0)