Skip to content

Commit f688959

Browse files
committed
Add enum case signature
Knowing case value can be useful
1 parent 784a49a commit f688959

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% set code %}{% apply spaceless %}
2+
{% if node.parent.backedType %}
3+
<span class="phpdocumentor-signature__type">{{ node.parent.backedType }} </span>
4+
{% endif %}
5+
<span class="phpdocumentor-signature__name">{{ node.name }}</span> = <span class="phpdocumentor-signature__default-value">{{ node.value | default('""') }}</span>
6+
{% endapply %}{% endset %}
7+
8+
{% include 'components/signature.html.twig' with { code } %}

tools/php_api_ref/.phpdoc/template/components/enum-case.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{% embed 'components/content-header.html.twig' with { node: case, anchor: 'enumcase_' ~ case.name, anchor_link: link(case), header_tag: 'h3' } %}
33
{% endembed %}
44
{% include 'components/summary.html.twig' with { node: case } %}
5+
{% include 'components/enum-case-signature.html.twig' with { node: case } %}
56
{% include 'components/deprecation.html.twig' with { node: case } %}
67
{% include 'components/description.html.twig' with { node: case } %}
78
{% include 'components/description.html.twig' with { node: case.var[0] } %}

0 commit comments

Comments
 (0)