Skip to content

Commit 4ba46c6

Browse files
dereuromarkADmad
andauthored
Fix up return descr (#331)
* Fix up return descr * Revert changes to composer.lock --------- Co-authored-by: ADmad <[email protected]>
1 parent 1ef7c3c commit 4ba46c6

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Factory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ protected function reflectFuncLike(ReflectedFunction $func, FunctionLike $node,
369369
$func->nativeReturnType = DocUtil::parseType(PrintUtil::node($node->getReturnType()));
370370
}
371371
$func->returnType = $doc->tags['return']?->type ?? $func->nativeReturnType;
372+
$func->returnDescription = $doc->tags['return']?->description ?? '';
372373
}
373374

374375
/**

src/Reflection/ReflectedFunction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class ReflectedFunction extends ReflectedNode
3030

3131
public ?TypeNode $nativeReturnType = null;
3232

33+
public string $returnDescription = '';
34+
3335
public bool $abstract = false;
3436

3537
public bool $static = false;

templates/pages/parts/function-detail.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@
7676
<h6>Returns</h6>
7777
<div class="list">
7878
<code>{{ function.returnType|type }}</code><br>
79-
{# {{ (return.description ?? '')|markdown_to_html }} #}
79+
{% if function.returnDescription %}
80+
{{ function.returnDescription|markdown_to_html }}
81+
{% endif %}
8082
</div>
8183
{% endif %}
8284

0 commit comments

Comments
 (0)