File tree Expand file tree Collapse file tree 4 files changed +43
-23
lines changed Expand file tree Collapse file tree 4 files changed +43
-23
lines changed Original file line number Diff line number Diff line change @@ -136,3 +136,35 @@ class
136
136
{% if member .static %} static{% endif %}
137
137
{% endspaceless %}
138
138
{%- endmacro -%}
139
+
140
+ {% macro method_parameters_signature(method ) -%}
141
+ {%- from " macros.twig" import hint_link -%}
142
+ (
143
+ {%- for parameter in method .parameters %}
144
+ {%- if parameter .hashint %}{{ hint_link(parameter .hint ) }} {% endif -%}
145
+ {%- if parameter .variadic %}...{% endif %}${{ parameter .name | raw }}
146
+ {%- if parameter .default is not null %} = {{ parameter .default }}{% endif %}
147
+ {%- if not loop .last %}, {% endif %}
148
+ {%- endfor -%}
149
+ )
150
+ {%- endmacro %}
151
+
152
+ {% macro hint_link(hints ) -%}
153
+ {%- from _self import class_link %}
154
+
155
+ {%- if hints %}
156
+ {%- for hint in hints %}
157
+ {%- if hint .class %}
158
+ {{- class_link(hint .name ) }}
159
+ {%- elseif hint .name %}
160
+ {{- abbr_class(hint .name ) }}
161
+ {%- endif %}
162
+ {%- if hint .array %}[]{% endif %}
163
+ {%- if not loop .last %}|{% endif %}
164
+ {%- endfor %}
165
+ {%- endif %}
166
+ {%- endmacro %}
167
+
168
+ {% macro class_link(class , absolute ) -%}
169
+ {{- class }}
170
+ {%- endmacro %}
Original file line number Diff line number Diff line change @@ -36,50 +36,33 @@ The {{ class_type(class) }} defines the following methods:
36
36
{% if method .name != " __construct" %}
37
37
38
38
39
- {% if class .shortname != " ClientBuilder" %}
40
39
[[{{ sanitize(replace_backslash(method )~" _" ~method.name ) }}]]
41
40
.`{{ method .name }}()`
42
41
{% if method.tags (' note' ) %}
43
42
{% for note in method.tags (' note' ) %}
44
43
*NOTE:* {{ note | join (' ' ) }}
45
44
{% endfor %}
46
45
{% endif %}
47
- ****
48
- [source,php]
49
- ----
50
- /*
51
- {% if method .shortdesc %}
52
- {{ method .shortdesc | raw }}
53
- {% endif %}
54
- */
55
-
56
- $params = [
57
- // ...
58
- ];
59
-
60
- $client = ClientBuilder::create()->build();
61
- $response = {{ get_namespace(class ) }}->{{ method .name }}({{ param_list(method )| trim (' ,' ) }});
62
- ----
63
- ****
64
- {% else %}
65
46
[[{{ sanitize(replace_backslash(method )~" _" ~method.name ) }}]]
66
- .`{{ method .name }}() `
47
+ .`{{ method .name }}{{ block ( ' method_parameters_signature ' ) }} `
67
48
****
68
49
[source,php]
69
50
----
70
51
/*
71
52
{% if method .shortdesc %}
72
- {{ method .shortdesc | raw }}
53
+ {{ method .shortdesc | raw }}
73
54
{% endif %}
74
55
*/
75
-
76
56
----
77
57
****
78
58
{% endif %}
79
- {% endif %}
80
59
81
60
{% endfor %}
82
61
{% endif %}
83
62
84
63
{% endblock %}
85
64
65
+ {% block method_parameters_signature -%}
66
+ {%- from " macros.twig" import method_parameters_signature -%}
67
+ {{ method_parameters_signature(method ) }}
68
+ {%- endblock %}
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ class Client
89
89
}
90
90
91
91
/**
92
+ * Extract an argument from the array of parameters
93
+ *
92
94
* @return null|mixed
93
95
*/
94
96
public function extractArgument(array &$params, string $arg)
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Returns the :name namespace
3
+ */
1
4
public function :name(): :namespace
2
5
{
3
6
return $this->:name;
You can’t perform that action at this time.
0 commit comments