Skip to content

Commit ef48c80

Browse files
committed
chore(docs.tmpl): make collaspible. add throws. fix return/param
1 parent a8898a6 commit ef48c80

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

resources/docs/docs.twig

+13-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,24 @@ use {{class.classFqcn}};
2121
> {{method.title}}
2222
{% endif %}
2323

24+
<details><summary>Details …</summary>
25+
<div>
26+
2427
```php
25-
{{method.isStatic ? '::' : ''}}{{name}}({{method.params|join(', ')}}){{method.return ? ': ' ~ method.return : ''}}
28+
{% set params = call('array_column', method.params, 0) %}
29+
{{method.isStatic ? '::' : ''}}{{name}}({{params|join(', ')}}){{method.return ? ': ' ~ method.return[0] : ''}}
2630
```
2731
{% if method.texts %}
2832

29-
{{method.texts|join("\n")|replace({'<code>':"```php",'</code>':"```"})|raw}}
33+
{{method.texts|join("\n\n")|replace({'<code>':"```php", '</code>':"```"})|raw|nl2br}}
34+
{% endif %}
35+
{% if method.throws %}
36+
37+
> _Throws_ **{{method.throws[0]}}** {{ method.throws[1] ? '_' ~ method.throws[1] ~ '_' : '' }}
3038
{% endif %}
39+
40+
</div>
41+
</details>
3142
{% endfor %}
3243

3344
**[⬆ back to top](#the-top)**

0 commit comments

Comments
 (0)