Skip to content

Commit c846ffc

Browse files
committed
Fix creating param from variable inherits default value
1 parent 47812d2 commit c846ffc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/PhpParam.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public static function fromVariable(PhpVariable $var): self
2525
{
2626
$self = new self($var->getIdentifier()->getName(), $var->getType());
2727
$self->variable = $var;
28+
if ($var->getInitializedValue() !== PhpVariable::NO_VALUE) {
29+
$self->setValue($var->getInitializedValue());
30+
}
2831
return $self;
2932
}
3033

0 commit comments

Comments
 (0)