Skip to content

Commit cf3bec3

Browse files
committed
Merge branch 'extend-phpdoc-coverage' into rector-phpdoc-html
2 parents 03bc585 + e31ac34 commit cf3bec3

File tree

12 files changed

+134
-11
lines changed

12 files changed

+134
-11
lines changed

tools/php_api_ref/.phpdoc/template/base.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends 'layout.html.twig' %}
22

3-
{% set symfony_version = '5.4' %}
3+
{% set symfony_version = 'SF_VERSION' %}
44

55
{% block javascripts %}
66
{{ parent() }}

tools/php_api_ref/.phpdoc/template/components/constant.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
{% include 'components/description.html.twig' with { node: constant } %}
1010
{% include 'components/description.html.twig' with { node: constant.var[0] } %}
1111
{% include 'components/tags.html.twig' with {node: constant } %}
12+
{% include 'components/attributes.html.twig' with { node: constant } %}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<article class="phpdocumentor-element-enum-case">
2+
{% embed 'components/content-header.html.twig' with { node: case, anchor: 'enumcase_' ~ case.name, anchor_link: link(case), header_tag: 'h3' } %}
3+
{% endembed %}
4+
{% include 'components/summary.html.twig' with { node: case } %}
5+
{% include 'components/deprecation.html.twig' with { node: case } %}
6+
{% include 'components/description.html.twig' with { node: case } %}
7+
{% include 'components/description.html.twig' with { node: case.var[0] } %}
8+
{% include 'components/tags.html.twig' with { node: case } %}
9+
{% include 'components/attributes.html.twig' with { node: case } %}
10+
</article>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% set breadcrumbs = usesNamespaces ? breadcrumbs(node) : packages(node) %}
2+
{% set fqcn = breadcrumbs|map(breadcrumb => breadcrumb.name)|join('\\') ~ '\\' ~ node.name %}
3+
4+
{% embed 'components/content-header.html.twig' with {
5+
anchor: node.name,
6+
anchor_link: '#' ~ node.name,
7+
fqcn,
8+
add_edition: true,
9+
} %}
10+
{% block name %}
11+
{{ node.name }}
12+
{% endblock %}
13+
{% block subheader %}
14+
<div class="content-header__subheader">
15+
Enum
16+
{%- if node.backedType -%}
17+
: {{ node.backedType }}
18+
{% endif %}
19+
</div>
20+
{% endblock %}
21+
{% endembed %}

tools/php_api_ref/.phpdoc/template/components/menu-entry.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set is_nested = entry.children.count or entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined %}
1+
{% set is_nested = entry.children.count or entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
22
{% set url = entry|route("url")|raw %}
33
{% set type = type|default('') %}
44

tools/php_api_ref/.phpdoc/template/components/menu.html.twig

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
</ul>
3636
{% endif %}
3737

38-
{% if entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined %}
38+
{% if entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
3939
{% if depth > 1 %}
4040
<label class="md-nav__list-title">
41-
Interfaces, classes, and traits
41+
Interfaces, classes, traits, and enums
4242
</label>
4343
{% endif %}
4444
<ul class="md-nav__list">
@@ -78,6 +78,19 @@
7878
icon: 'file.svg',
7979
} %}
8080

81+
{% set index = index + 1 %}
82+
{% endfor %}
83+
{% endif %}
84+
{% if entry.enums[0] is defined %}
85+
{% for element in entry.enums|sort_asc %}
86+
{% include 'components/menu-entry.html.twig' with {
87+
title: element.name|shortFQSEN,
88+
nav_id: nav_id ~ '-' ~ index,
89+
entry: element,
90+
expanded: false,
91+
icon: 'file.svg',
92+
} %}
93+
8194
{% set index = index + 1 %}
8295
{% endfor %}
8396
{% endif %}

tools/php_api_ref/.phpdoc/template/components/method.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
{% include 'components/method-arguments.html.twig' with { node: method } %}
1616
{% include 'components/method-response.html.twig' with { node: method } %}
1717
{% include 'components/tags.html.twig' with { node: method } %}
18+
{% include 'components/attributes.html.twig' with { node: method } %}

tools/php_api_ref/.phpdoc/template/components/property.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
{% include 'components/description.html.twig' with { node: property } %}
1414
{% include 'components/description.html.twig' with { node: property.var[0] } %}
1515
{% include 'components/tags.html.twig' with {node: property } %}
16+
{% include 'components/attributes.html.twig' with { node: property } %}

tools/php_api_ref/.phpdoc/template/components/table-of-contents.html.twig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,17 @@
5252
{% if node.traits[0] is defined %}
5353
{% set joined_data = joined_data|merge(node.traits) %}
5454
{% endif %}
55+
{% if node.enums[0] is defined %}
56+
{% set joined_data = joined_data|merge(node.enums) %}
57+
{% endif %}
5558

5659
{% if joined_data is not empty %}
5760
<h2 id="interfaces">
58-
Interfaces, classes, and traits
61+
Interfaces, classes, traits, and enums
5962
{%- include 'components/anchor.html.twig' with { anchor_link: link(node) ~ '#interfaces' } -%}
6063
</h2>
6164
<ul class="namespace-list">
62-
{% for entry in joined_data %}
65+
{% for entry in joined_data|sort((entry1, entry2) => entry1.name <=> entry2.name) %}
6366
<li>
6467
<span>
6568
<img src="./images/arrow-right.svg" class="arrow" />

tools/php_api_ref/.phpdoc/template/css/base.css.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,6 @@ ul.breadcrumbs li.breadcrumb-item-current span {
585585

586586
}
587587

588-
.phpdocumentor-admonition article {
588+
.phpdocumentor-admonition article, .phpdocumentor-cases article {
589589
padding-bottom: 0;
590590
}

0 commit comments

Comments
 (0)