Skip to content

Commit b0f6bd6

Browse files
committed
Fix ExtendedNativeParameterReflection
1 parent c993754 commit b0f6bd6

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/Reflection/Native/ExtendedNativeParameterReflection.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/Reflection/Native/NativeParameterReflection.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ public function getDefaultValue(): ?Type
5151
return $this->defaultValue;
5252
}
5353

54-
public function union(self $other): self
54+
public function union(ParameterReflection $other): self
5555
{
5656
return new self(
5757
$this->name,
58-
$this->optional && $other->optional,
59-
TypeCombinator::union($this->type, $other->type),
60-
$this->passedByReference->combine($other->passedByReference),
61-
$this->variadic && $other->variadic,
62-
$this->optional && $other->optional ? $this->defaultValue : null,
58+
$this->optional && $other->isOptional(),
59+
TypeCombinator::union($this->type, $other->getType()),
60+
$this->passedByReference->combine($other->passedByReference()),
61+
$this->variadic && $other->isVariadic(),
62+
$this->optional && $other->isOptional() ? $this->defaultValue : null,
6363
);
6464
}
6565

0 commit comments

Comments
 (0)