Skip to content

Commit 341d654

Browse files
committed
spacing fixes
1 parent c0b79ac commit 341d654

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/php/base/requests/params.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
$params = [];
2+
{% if method.parameters.all | length %}
13
{% for parameter in method.parameters.all %}
24
{% if parameter.required %}
35
if (!isset(${{ parameter.name | caseCamel | escapeKeyword }})) {
46
throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"');
57
}
68
{% endif %}
79
{% endfor %}
8-
910
{% for parameter in method.parameters.query %}
1011
if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) {
1112
$params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }};
@@ -22,4 +23,5 @@
2223
if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) {
2324
$params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }};
2425
}
25-
{% endfor %}
26+
{% endfor %}
27+
{% endif %}

templates/php/src/Services/Service.php.twig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ class {{ service.name | caseUcfirst }} extends Service
2626
public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }}
2727
{
2828
$path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}');
29-
$params = [];
3029
3130
{{ include('php/base/requests/params.twig') }}
32-
3331
{% if 'multipart/form-data' in method.consumes %}
3432
{{ include('php/base/requests/file.twig') }}
3533
{% else %}

0 commit comments

Comments
 (0)