-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathfunction-detail.twig
More file actions
113 lines (103 loc) · 4.03 KB
/
function-detail.twig
File metadata and controls
113 lines (103 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<div class="section">
<h2>{{ title|default('Method') }} Detail</h2>
{% for function in functions %}
<div class="method-detail">
<a id="{{ function.name }}()"></a>
<h3 class="method-name">
{{ function.name }}()
<a href="#{{ function.name }}()" class="permalink" title="Permalink to {{ function.name}}()">¶</a>
{% if function.source.inProject %}
<a href="{{ function|node_to_repo_url }}" class="permalink" title="Permalink to Github" target="_blank"><i class="fa-brands fa-github"></i></a>
{% endif %}
{% if function.abstract|default(false) %}
<span class="label">abstract</span>
{% endif %}
{% if function.visibility is defined %}
<span class="label">{{ function.visibility }}</span>
{% endif %}
{% if function.static %}
<span class="label">static</span>
{% endif %}
{% if function.annotation|default(null) %}
<span class="label annotation">{{ function.annotation }}</span>
{% endif %}
{% if function.doc.tags.depecated is defined %}
<span class="label">deprecated</span>
{% endif %}
</h3>
<pre><code class="language-php">
{{- function.name }}(
{%- for param in function.params %}
{{- param.type|type|default('mixed') }} {% if param.variadic %}...{% endif %}${{ param.name }}{{ param.default is not null ? ' = ' ~ param.default : '' }}{{ loop.last?'':', ' }}
{%- endfor -%}
){{ function.returnType ? ': ' ~ function.returnType|type : '' -}}
</code></pre>
<div class="description detailed">
{{ function.doc.summary|markdown_to_html }}
{{ function.doc.description|markdown_to_html }}
{% if function.doc.tags.template is defined %}
<h6>Templates</h6>
<div class="list">
{% for tag in function.doc.tags.template %}
<code>
{{ tag.name }}
{% if tag.bound is not null %} of {tag.bound}{% endif %}
{% if tag.default is not null %} = {tag.default}{% endif %}
</code><br>
{{ tag.description }}{{ loop.last ? '' : '<br>' }}
{% endfor %}
</div>
{% endif %}
{% if function.params %}
<h6>Parameters</h6>
<div class="parameter-list list">
<dl>
{% for param in function.params %}
<dt>
<code>{{ param.type|type }}</code>
{% if param.variadic %}...{% endif %}<var>${{ param.name }}</var>
{% if param.default is not null %}
<span class="label">optional</span>
{% endif %}
</dt>
<dd>{{ (param.description ?? '')|markdown_to_html }}</dd>
{% endfor %}
</dl>
</div>
{% endif %}
{% if function.returnType %}
<h6>Returns</h6>
<div class="list">
<code>{{ function.returnType|type }}</code><br>
{# {{ (return.description ?? '')|markdown_to_html }} #}
</div>
{% endif %}
{% if function.doc.tags.throws is defined %}
<h6>Throws</h6>
<div class="list">
{% for tag in function.doc.tags.throws %}
<code>{{ tag.type|type }}</code><br>
{{ tag.description }}{{ loop.last ? '' : '<br>' }}
{% endfor %}
</div>
{% endif %}
{% if function.doc.tags.see is defined %}
<h6>See Also</h6>
<div class="list">
{% for tag in function.doc.tags.see %}
{{ tag.value }}</a>{{ loop.last ? '': '<br>' }}
{% endfor %}
</div>
{% endif %}
{% if function.doc.tags.link is defined %}
<h6>Links</h6>
<div class="list">
{% for tag in function.doc.tags.link %}
{{ tag.value }}</a><br>{{ loop.last ? '' : '<br>' }}
{% endfor %}
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>