Skip to content

Commit 0067174

Browse files
committed
Resync .phpdoc
1 parent 25a40ff commit 0067174

File tree

3 files changed

+137
-5
lines changed

3 files changed

+137
-5
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 %}
2+
{% set url = entry|route("url")|raw %}
3+
{% set type = type|default('') %}
4+
5+
{% if type != 'namespace' or is_nested %}
6+
<li class="md-nav__item {{ is_nested ? 'md-nav__item--nested' : '' }}">
7+
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-{{ nav_id }}" type="checkbox" id="nav-{{ nav_id }}" {{ expanded|default(false) ? 'checked' : ''}}>
8+
<label class="md-nav__link level-{{ depth }}" for="nav-{{ nav_id }}">
9+
{% if icon is defined and depth > 1 %}
10+
<img src="./images/{{ icon }}" alt="{{ icon }}" />
11+
{% endif %}
12+
{% if url %}
13+
<a href="{{ url }}" title="{{ title }}">
14+
{% endif %}
15+
{{ title }}
16+
{% if url %}
17+
</a>
18+
{% endif %}
19+
</label>
20+
{% if is_nested %}
21+
<nav class="md-nav" aria-label="{{ title }}" data-md-level="{{ depth }}">
22+
<label class="md-nav__link-title md-nav__link level-{{ depth }}" title="{{ node.name }}">
23+
{{ title }}
24+
</label>
25+
{% include 'components/menu.html.twig' with { entry, nav_id, depth: depth + 1, type: '' } %}
26+
</nav>
27+
{% endif %}
28+
</li>
29+
{% endif %}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{% if depth == 0 %}
2+
{% if entry.children.count > 0 %}
3+
{% for child in entry.children %}
4+
{% include 'components/menu-entry.html.twig' with {
5+
title: entry.name|shortFQSEN ~ ' ' ~ child.name|shortFQSEN,
6+
nav_id: nav_id ~ '-' ~ loop.index,
7+
expanded: true,
8+
entry: child,
9+
} %}
10+
{% endfor %}
11+
{% endif %}
12+
{% else %}
13+
14+
{% set index = 0 %}
15+
16+
{% if entry.children.count > 0 %}
17+
{% if depth > 1 %}
18+
<label class="md-nav__list-title md-nav__list-title--namespaces">
19+
Namespaces
20+
</label>
21+
{% endif %}
22+
<ul class="md-nav__list">
23+
{% for child in entry.children %}
24+
{% include 'components/menu-entry.html.twig' with {
25+
title: child.name|shortFQSEN,
26+
nav_id: nav_id ~ '-' ~ index,
27+
entry: child,
28+
expanded: false,
29+
icon: 'folder.svg',
30+
type: 'namespace',
31+
} %}
32+
33+
{% set index = index + 1 %}
34+
{% endfor %}
35+
</ul>
36+
{% endif %}
37+
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 %}
39+
{% if depth > 1 %}
40+
<label class="md-nav__list-title">
41+
Interfaces, classes, traits, and enums
42+
</label>
43+
{% endif %}
44+
<ul class="md-nav__list">
45+
{% if entry.interfaces[0] is defined %}
46+
{% for element in entry.interfaces|sort_asc %}
47+
{% include 'components/menu-entry.html.twig' with {
48+
title: element.name|shortFQSEN,
49+
nav_id: nav_id ~ '-' ~ index,
50+
entry: element,
51+
expanded: false,
52+
icon: 'file.svg',
53+
} %}
54+
55+
{% set index = index + 1 %}
56+
{% endfor %}
57+
{% endif %}
58+
{% if entry.classes[0] is defined %}
59+
{% for element in entry.classes|sort_asc %}
60+
{% include 'components/menu-entry.html.twig' with {
61+
title: element.name|shortFQSEN,
62+
nav_id: nav_id ~ '-' ~ index,
63+
entry: element,
64+
expanded: false,
65+
icon: 'file.svg',
66+
} %}
67+
68+
{% set index = index + 1 %}
69+
{% endfor %}
70+
{% endif %}
71+
{% if entry.traits[0] is defined %}
72+
{% for element in entry.traits|sort_asc %}
73+
{% include 'components/menu-entry.html.twig' with {
74+
title: element.name|shortFQSEN,
75+
nav_id: nav_id ~ '-' ~ index,
76+
entry: element,
77+
expanded: false,
78+
icon: 'file.svg',
79+
} %}
80+
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+
94+
{% set index = index + 1 %}
95+
{% endfor %}
96+
{% endif %}
97+
</ul>
98+
{% endif %}
99+
{% endif %}

tools/api_refs/.phpdoc/template/trait.html.twig

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,16 @@
5252
</a>
5353
<nav class="md-nav">
5454
<ul class="md-nav__list">
55+
{% set treated_properties = [] %}
5556
{% for property in properties|sortByVisibility %}
56-
<li class="md-nav__item level-2">
57-
<a href="{{ link(property) }}" title="{{ property.name }}" class="md-nav__link">
58-
{{ property.name }}
59-
</a>
60-
</li>
57+
{% if property.__toString() not in treated_properties %}
58+
<li class="md-nav__item level-2">
59+
<a href="{{ link(property) }}" title="{{ property.name }}" class="md-nav__link">
60+
{{ property.name }}
61+
</a>
62+
</li>
63+
{% set treated_properties = treated_properties|merge([property.__toString()]) %}
64+
{% endif %}
6165
{% endfor %}
6266
</ul>
6367
</nav>

0 commit comments

Comments
 (0)