Skip to content

Commit b12901e

Browse files
committed
fix bug with nullable parameter types
1 parent 45fc42f commit b12901e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Results/Nodes/ParameterNode.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ class ParameterNode implements ResultNode
2222
public function __construct(Node\Param $node)
2323
{
2424
$this->name = $node->var->name;
25-
$this->type = optional($node->type)->toString();
25+
26+
if ($node->type instanceof Node\NullableType) {
27+
$this->type = $node->getType();
28+
} else {
29+
$this->type = optional($node->type)->toString();
30+
}
31+
2632
$this->default = $node->default ? ExpressionTransformer::parserNodeToResultNode($node->default) : null;
2733
$this->location = GenericCodeLocation::createFromNode($node);
2834
}

0 commit comments

Comments
 (0)