-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #919 from appwrite/fix-php
Fix PHP
- Loading branch information
Showing
11 changed files
with
77 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,8 @@ jobs: | |
Node16, | ||
Node18, | ||
Node20, | ||
PHP74, | ||
PHP80, | ||
PHP83, | ||
Python38, | ||
Python39, | ||
Python310, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
$apiParams = []; | ||
{% if method.parameters.all | length %} | ||
{% for parameter in method.parameters.all %} | ||
{% if parameter.required and not parameter.nullable %} | ||
if (!isset(${{ parameter.name | caseCamel | escapeKeyword }})) { | ||
throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); | ||
} | ||
{% endif %} | ||
{% endfor %} | ||
{% for parameter in method.parameters.query %} | ||
if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { | ||
$apiParams['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; | ||
} | ||
{% endfor %} | ||
{% for parameter in method.parameters.body %} | ||
if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { | ||
$apiParams['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; | ||
} | ||
{% endfor %} | ||
{% for parameter in method.parameters.formData %} | ||
{% if not parameter.required and not parameter.nullable %} | ||
|
||
if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { | ||
$apiParams['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; | ||
} | ||
{% else %} | ||
$apiParams['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endif %} | ||
|
||
$apiHeaders = []; | ||
{%~ for parameter in method.parameters.header %} | ||
$apiHeaders['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; | ||
{%~ endfor %} | ||
{%~ for key, header in method.headers %} | ||
$apiHeaders['{{ key }}'] = '{{ header }}'; | ||
{%~ endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
return $this->client->call( | ||
Client::METHOD_{{ method.method | caseUpper }}, | ||
$apiPath, | ||
[ | ||
{%~ for parameter in method.parameters.header %} | ||
'{{ parameter.name }}' => ${{ parameter.name | caseCamel | escapeKeyword }}, | ||
{%~ endfor %} | ||
{%~ for key, header in method.headers %} | ||
'{{ key }}' => '{{ header }}', | ||
{%~ endfor %} | ||
], | ||
$apiHeaders, | ||
$apiParams{% if method.type == 'webAuth' -%}, 'location'{% endif %} | ||
|
||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.