From 341d6542f6b8843b77ed0dc70c146ce2e7fa623d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 20 Jun 2022 07:37:33 +0000 Subject: [PATCH] spacing fixes --- templates/php/base/requests/params.twig | 6 ++++-- templates/php/src/Services/Service.php.twig | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/php/base/requests/params.twig b/templates/php/base/requests/params.twig index c310f45f5..04813d936 100644 --- a/templates/php/base/requests/params.twig +++ b/templates/php/base/requests/params.twig @@ -1,3 +1,5 @@ + $params = []; +{% if method.parameters.all | length %} {% for parameter in method.parameters.all %} {% if parameter.required %} if (!isset(${{ parameter.name | caseCamel | escapeKeyword }})) { @@ -5,7 +7,6 @@ } {% endif %} {% endfor %} - {% for parameter in method.parameters.query %} if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; @@ -22,4 +23,5 @@ if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; } -{% endfor %} \ No newline at end of file +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index 03d01f52d..e9eb66530 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -26,10 +26,8 @@ class {{ service.name | caseUcfirst }} extends Service 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 }} { $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 }}'); - $params = []; {{ include('php/base/requests/params.twig') }} - {% if 'multipart/form-data' in method.consumes %} {{ include('php/base/requests/file.twig') }} {% else %}