Skip to content

Commit 659f086

Browse files
committed
Use header param
1 parent 954f3d6 commit 659f086

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

templates/php/base/params.twig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@
2222
$apiParams['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }};
2323
}
2424
{% endfor %}
25-
{% endif %}
25+
{% endif %}
26+
$apiHeaders = [];
27+
{%~ for parameter in method.parameters.header %}
28+
$apiHeaders['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }};
29+
{%~ endfor %}
30+
{%~ for key, header in method.headers %}
31+
$apiHeaders['{{ key }}'] = '{{ header }}';
32+
{%~ endfor %}

templates/php/base/requests/api.twig

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
return $this->client->call(
22
Client::METHOD_{{ method.method | caseUpper }},
33
$apiPath,
4-
[
5-
{%~ for parameter in method.parameters.header %}
6-
'{{ parameter.name }}' => ${{ parameter.name | caseCamel | escapeKeyword }},
7-
{%~ endfor %}
8-
{%~ for key, header in method.headers %}
9-
'{{ key }}' => '{{ header }}',
10-
{%~ endfor %}
11-
],
4+
$apiHeaders,
125
$apiParams{% if method.type == 'webAuth' -%}, 'location'{% endif %}
136

147
);

0 commit comments

Comments
 (0)