Skip to content

Commit 36a6b4c

Browse files
committed
Fix header casting and more minor fixes
1 parent a047caa commit 36a6b4c

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

docs/examples/functions/create-tag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ $client
1313

1414
$functions = new Functions($client);
1515

16-
$result = $functions->createTag('[FUNCTION_ID]', '[COMMAND]', new \CURLFile('/path/to/file.png', 'image/png', 'file.png'));
16+
$result = $functions->createTag('[FUNCTION_ID]', '[COMMAND]', '');

docs/examples/storage/create-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ $client
1313

1414
$storage = new Storage($client);
1515

16-
$result = $storage->createFile(new \CURLFile('/path/to/file.png', 'image/png', 'file.png'));
16+
$result = $storage->createFile('');

docs/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Use the "command" param to set the entry point used to execute your co
184184
| --- | --- | --- | --- |
185185
| functionId | string | **Required** Function unique ID. | |
186186
| command | string | Code execution command. | |
187-
| code | file | Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. | |
187+
| code | string | Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. | |
188188

189189
## Get Tag
190190

docs/storage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ POST https://appwrite.io/v1/storage/files
2929

3030
| Field Name | Type | Description | Default |
3131
| --- | --- | --- | --- |
32-
| file | file | Binary file. | |
32+
| file | string | Binary file. | |
3333
| read | array | An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
3434
| write | array | An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
3535

@@ -110,7 +110,7 @@ GET https://appwrite.io/v1/storage/files/{fileId}/preview
110110
| borderWidth | integer | Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. | 0 |
111111
| borderColor | string | Preview image border color. Use a valid HEX color, no # is needed for prefix. | |
112112
| borderRadius | integer | Preview image border radius in pixels. Pass an integer between 0 to 4000. | 0 |
113-
| opacity | integer | Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. | 1 |
113+
| opacity | number | Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. | 1 |
114114
| rotation | integer | Preview image rotation in degrees. Pass an integer between 0 and 360. | 0 |
115115
| background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | |
116116
| output | string | Output format type (jpeg, jpg, png, gif and webp). | |

src/Appwrite/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Client
3535
*/
3636
protected $headers = [
3737
'content-type' => '',
38-
'x-sdk-version' => 'appwrite:php:2.1.0',
38+
'x-sdk-version' => 'appwrite:php:2.1.1',
3939
];
4040

4141
/**
@@ -138,7 +138,7 @@ public function setEndpoint($endpoint)
138138
*/
139139
public function addHeader($key, $value)
140140
{
141-
$this->headers[strtolower($key)] = strtolower($value);
141+
$this->headers[strtolower($key)] = $value;
142142

143143
return $this;
144144
}

src/Appwrite/Services/Functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ public function listTags(string $functionId, string $search = '', int $limit = 2
289289
*
290290
* @param string $functionId
291291
* @param string $command
292-
* @param \CurlFile $code
292+
* @param string $code
293293
* @throws Exception
294294
* @return array
295295
*/
296-
public function createTag(string $functionId, string $command, \CurlFile $code):array
296+
public function createTag(string $functionId, string $command, string $code):array
297297
{
298298
$path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tags');
299299
$params = [];

src/Appwrite/Services/Storage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ public function listFiles(string $search = '', int $limit = 25, int $offset = 0,
4444
* assigned to read and write access unless he has passed custom values for
4545
* read and write arguments.
4646
*
47-
* @param \CurlFile $file
47+
* @param string $file
4848
* @param array $read
4949
* @param array $write
5050
* @throws Exception
5151
* @return array
5252
*/
53-
public function createFile(\CurlFile $file, array $read = [], array $write = []):array
53+
public function createFile(string $file, array $read = [], array $write = []):array
5454
{
5555
$path = str_replace([], [], '/storage/files');
5656
$params = [];

0 commit comments

Comments
 (0)