Skip to content

Commit 6d5fc0e

Browse files
committed
🎨 Improve method signature print
🐛 🔥 Missing type for arguments: non typed arguments are 'mixed' by default now
1 parent c06206f commit 6d5fc0e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

data/templates/vuepress/method.md.twig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
{# Method signature #}
66
```php
77
{{ method.visibility }}{% if method.static %} static{% endif %} {{ method.name }}( {% for argument in method.arguments %}
8-
{{- argument.types ? argument.types|join('|')~' ' }}
8+
{{- argument.types|default(['mixed'])|join('|')~' ' }}
99
{{- argument.byReference ? '&' }}
10-
{{- argument.name }}{% if argument.default %} = {{ argument.default|raw }} {% endif %}
11-
{%- if not loop.last %}, {% endif %}
12-
{%- endfor %} )
13-
{{- method.response.types ? ': '~method.response.types|join('|') }}
10+
{{- argument.name }}{% if argument.default %} = {{ argument.default|raw }}{% endif %}
11+
{%- if not loop.last %}, {% endif -%}
12+
{%- endfor -%}
13+
{{- ' ) : ' ~ method.response.types|default('void')|join('|') }}
1414
```
1515

1616
{% if method.arguments is not empty %}
1717
| Parameter | Type(s) | Description |
1818
|-----------|------|-------------|
1919
{% for argument in method.arguments %}
20-
| `{{ argument.name }}` {{ include('badges.md.twig', { elem: argument }) }} | **`{{ argument.types ? argument.types|join('`** <br /> **`')|raw }}`** | {{ argument.description|replace({'|': '&#124;', "\n": ' ', "\r": ' '})|raw }} |
20+
| `{{ argument.name }}` {{ include('badges.md.twig', { elem: argument }) }} | **`{{ argument.types|default(['mixed'])|join('`** <br /> **`')|raw }}`** | {{ argument.description|replace({'|': '&#124;', "\n": ' ', "\r": ' '})|raw }} |
2121
{% endfor %}
2222
{% endif %}{# method.arguments is not empty #}
2323

0 commit comments

Comments
 (0)