@@ -99,21 +99,21 @@ public function getAttributes(): array
9999 return $ this ->attributes ;
100100 }
101101
102- public function union (self $ other ): self
102+ public function union (ExtendedParameterReflection $ other ): self
103103 {
104104 return new self (
105105 $ this ->name ,
106- $ this ->optional && $ other ->optional ,
107- TypeCombinator::union ($ this ->type , $ other ->type ),
108- TypeCombinator::union ($ this ->phpDocType , $ other ->phpDocType ),
109- TypeCombinator::union ($ this ->nativeType , $ other ->nativeType ),
110- $ this ->passedByReference ->combine ($ other ->passedByReference ),
111- $ this ->variadic && $ other ->variadic ,
112- $ this ->optional && $ other ->optional ? $ this ->defaultValue : null ,
113- $ this ->outType !== null && $ other ->outType !== null ? TypeCombinator::union ($ this ->outType , $ other ->outType ) : null ,
114- $ this ->immediatelyInvokedCallable ->and ($ other ->immediatelyInvokedCallable ),
115- $ this ->closureThisType !== null && $ other ->closureThisType !== null ? TypeCombinator::union ($ this ->closureThisType , $ other ->closureThisType ) : null ,
116- array_merge ($ this ->attributes , $ other ->attributes ),
106+ $ this ->optional && $ other ->isOptional () ,
107+ TypeCombinator::union ($ this ->type , $ other ->getType () ),
108+ TypeCombinator::union ($ this ->phpDocType , $ other ->getPhpDocType () ),
109+ TypeCombinator::union ($ this ->nativeType , $ other ->getNativeType () ),
110+ $ this ->passedByReference ->combine ($ other ->passedByReference () ),
111+ $ this ->variadic && $ other ->isVariadic () ,
112+ $ this ->optional && $ other ->isOptional () ? $ this ->defaultValue : null ,
113+ $ this ->outType !== null && $ other ->getOutType () !== null ? TypeCombinator::union ($ this ->outType , $ other ->getOutType () ) : null ,
114+ $ this ->immediatelyInvokedCallable ->and ($ other ->isImmediatelyInvokedCallable () ),
115+ $ this ->closureThisType !== null && $ other ->getClosureThisType () !== null ? TypeCombinator::union ($ this ->closureThisType , $ other ->getClosureThisType () ) : null ,
116+ array_merge ($ this ->attributes , $ other ->getAttributes () ),
117117 );
118118 }
119119
0 commit comments