Skip to content

Commit

Permalink
Fix creating param from variable inherits default value
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkan committed Oct 28, 2024
1 parent 47812d2 commit c846ffc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PhpParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public static function fromVariable(PhpVariable $var): self
{
$self = new self($var->getIdentifier()->getName(), $var->getType());
$self->variable = $var;
if ($var->getInitializedValue() !== PhpVariable::NO_VALUE) {
$self->setValue($var->getInitializedValue());
}
return $self;
}

Expand Down

0 comments on commit c846ffc

Please sign in to comment.