Skip to content

Commit 690dda3

Browse files
committed
🆕 Class|Interface constants section
1 parent 7c86d9b commit 690dda3

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
:::
3+
{%- if constant.visibility == 'protected' %}
4+
{{- 'warning ' -}}
5+
{% elseif constant.visibility == 'private' %}
6+
{{- 'danger ' -}}
7+
{% else %}
8+
{{- 'tip ' -}} {# TODO wait compatibiliti with PHP 7.1 constant visibility {{ constant.visibility }}#}
9+
{% endif -%}
10+
11+
{#{ include('anchor-ref-constant.md.twig') }#}
12+
{{- constant.name }} {{ include('badges.md.twig', { elem: constant }) }}
13+
-----
14+
15+
{{ constant.summary|replace({'#### ': '- ', '### ': '- ', '## ': '- ', '# ': '- ',}) }}
16+
17+
{# Constant value #}
18+
```php
19+
{# TODO wait compatibiliti with PHP 7.1 constant visibility {{ constant.visibility }}#}
20+
{{ constant.name }} = {{ constant.value|raw }};
21+
```
22+
23+
**Type:** **`{{ constant.types|default(['mixed'])|sort_asc|join('`** | **`')}}`**
24+
25+
{% if constant.description is not empty %}
26+
***Description:***
27+
28+
{{ constant.description|replace({'#### ': '- ', '### ': '- ', '## ': '- ', '# ': '- ',}) }}
29+
{% endif %}
30+
31+
{{ include('metadata-table.md.twig', { elem: constant }) }}
32+
33+
:::

data/templates/vuepress/struct-class.md.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@
8181

8282
{{ include('metadata-table.md.twig', { elem: class }) }}
8383

84+
### <span style="display: none;">{{ class }}</span> Constants
85+
{# Lista de constantes #}
86+
{% for constant in class.constants|sort_asc %}
87+
{% include 'member-constant.md.twig' %}
88+
{% else %}
89+
> This class has not constants.
90+
{% endfor %}
91+
8492
{% set methodsList = [] %}
8593
### <span style="display: none;">{{ class }}</span> Methods
8694
{# Lista de métodos públicos y protegidos #}

data/templates/vuepress/struct-interface.md.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040

4141
{{ include('metadata-table.md.twig', { elem: interface }) }}
4242

43+
### <span style="display: none;">{{ class }}</span> Constants
44+
{# Lista de constantes #}
45+
{% for constant in interface.constants|sort_asc %}
46+
{% include 'member-constant.md.twig' %}
47+
{% else %}
48+
> This interface has not constants.
49+
{% endfor %}
50+
4351
### <span style="display: none;">{{ interface }}</span> Methods
4452
{# Lista de métodos públicos y protegidos #}
4553
{% for method in interface.methods|sort_asc %}

0 commit comments

Comments
 (0)