Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ protected function reflectFuncLike(ReflectedFunction $func, FunctionLike $node,
$func->nativeReturnType = DocUtil::parseType(PrintUtil::node($node->getReturnType()));
}
$func->returnType = $doc->tags['return']?->type ?? $func->nativeReturnType;
$func->returnDescription = $doc->tags['return']?->description ?? '';
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/ReflectedFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class ReflectedFunction extends ReflectedNode

public ?TypeNode $nativeReturnType = null;

public string $returnDescription = '';

public bool $abstract = false;

public bool $static = false;
Expand Down
4 changes: 3 additions & 1 deletion templates/pages/parts/function-detail.twig
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@
<h6>Returns</h6>
<div class="list">
<code>{{ function.returnType|type }}</code><br>
{# {{ (return.description ?? '')|markdown_to_html }} #}
{% if function.returnDescription %}
{{ function.returnDescription|markdown_to_html }}
{% endif %}
</div>
{% endif %}

Expand Down
Loading