Skip to content

Commit 6733fca

Browse files
fix argument condition
1 parent 0932ca4 commit 6733fca

File tree

8 files changed

+113
-113
lines changed

8 files changed

+113
-113
lines changed

src/Appwrite/Client.php

+1-1
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.3.0',
38+
'x-sdk-version' => 'appwrite:php:2.3.1',
3939
];
4040

4141
/**

src/Appwrite/Services/Account.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ public function delete(): array
6565
*/
6666
public function updateEmail(string $email, string $password): array
6767
{
68-
if (empty($email)) {
68+
if (!isset($email)) {
6969
throw new AppwriteException('Missing required parameter: "email"');
7070
}
7171

72-
if (empty($password)) {
72+
if (!isset($password)) {
7373
throw new AppwriteException('Missing required parameter: "password"');
7474
}
7575

@@ -119,7 +119,7 @@ public function getLogs(): array
119119
*/
120120
public function updateName(string $name): array
121121
{
122-
if (empty($name)) {
122+
if (!isset($name)) {
123123
throw new AppwriteException('Missing required parameter: "name"');
124124
}
125125

@@ -149,7 +149,7 @@ public function updateName(string $name): array
149149
*/
150150
public function updatePassword(string $password, string $oldPassword = null): array
151151
{
152-
if (empty($password)) {
152+
if (!isset($password)) {
153153
throw new AppwriteException('Missing required parameter: "password"');
154154
}
155155

@@ -199,7 +199,7 @@ public function getPrefs(): array
199199
*/
200200
public function updatePrefs(array $prefs): array
201201
{
202-
if (empty($prefs)) {
202+
if (!isset($prefs)) {
203203
throw new AppwriteException('Missing required parameter: "prefs"');
204204
}
205205

@@ -234,11 +234,11 @@ public function updatePrefs(array $prefs): array
234234
*/
235235
public function createRecovery(string $email, string $url): array
236236
{
237-
if (empty($email)) {
237+
if (!isset($email)) {
238238
throw new AppwriteException('Missing required parameter: "email"');
239239
}
240240

241-
if (empty($url)) {
241+
if (!isset($url)) {
242242
throw new AppwriteException('Missing required parameter: "url"');
243243
}
244244

@@ -280,19 +280,19 @@ public function createRecovery(string $email, string $url): array
280280
*/
281281
public function updateRecovery(string $userId, string $secret, string $password, string $passwordAgain): array
282282
{
283-
if (empty($userId)) {
283+
if (!isset($userId)) {
284284
throw new AppwriteException('Missing required parameter: "userId"');
285285
}
286286

287-
if (empty($secret)) {
287+
if (!isset($secret)) {
288288
throw new AppwriteException('Missing required parameter: "secret"');
289289
}
290290

291-
if (empty($password)) {
291+
if (!isset($password)) {
292292
throw new AppwriteException('Missing required parameter: "password"');
293293
}
294294

295-
if (empty($passwordAgain)) {
295+
if (!isset($passwordAgain)) {
296296
throw new AppwriteException('Missing required parameter: "passwordAgain"');
297297
}
298298

@@ -370,7 +370,7 @@ public function deleteSessions(): array
370370
*/
371371
public function getSession(string $sessionId): array
372372
{
373-
if (empty($sessionId)) {
373+
if (!isset($sessionId)) {
374374
throw new AppwriteException('Missing required parameter: "sessionId"');
375375
}
376376

@@ -395,7 +395,7 @@ public function getSession(string $sessionId): array
395395
*/
396396
public function deleteSession(string $sessionId): array
397397
{
398-
if (empty($sessionId)) {
398+
if (!isset($sessionId)) {
399399
throw new AppwriteException('Missing required parameter: "sessionId"');
400400
}
401401

@@ -432,7 +432,7 @@ public function deleteSession(string $sessionId): array
432432
*/
433433
public function createVerification(string $url): array
434434
{
435-
if (empty($url)) {
435+
if (!isset($url)) {
436436
throw new AppwriteException('Missing required parameter: "url"');
437437
}
438438

@@ -463,11 +463,11 @@ public function createVerification(string $url): array
463463
*/
464464
public function updateVerification(string $userId, string $secret): array
465465
{
466-
if (empty($userId)) {
466+
if (!isset($userId)) {
467467
throw new AppwriteException('Missing required parameter: "userId"');
468468
}
469469

470-
if (empty($secret)) {
470+
if (!isset($secret)) {
471471
throw new AppwriteException('Missing required parameter: "secret"');
472472
}
473473

src/Appwrite/Services/Avatars.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Avatars extends Service
2525
*/
2626
public function getBrowser(string $code, int $width = null, int $height = null, int $quality = null): string
2727
{
28-
if (empty($code)) {
28+
if (!isset($code)) {
2929
throw new AppwriteException('Missing required parameter: "code"');
3030
}
3131

@@ -65,7 +65,7 @@ public function getBrowser(string $code, int $width = null, int $height = null,
6565
*/
6666
public function getCreditCard(string $code, int $width = null, int $height = null, int $quality = null): string
6767
{
68-
if (empty($code)) {
68+
if (!isset($code)) {
6969
throw new AppwriteException('Missing required parameter: "code"');
7070
}
7171

@@ -102,7 +102,7 @@ public function getCreditCard(string $code, int $width = null, int $height = nul
102102
*/
103103
public function getFavicon(string $url): string
104104
{
105-
if (empty($url)) {
105+
if (!isset($url)) {
106106
throw new AppwriteException('Missing required parameter: "url"');
107107
}
108108

@@ -134,7 +134,7 @@ public function getFavicon(string $url): string
134134
*/
135135
public function getFlag(string $code, int $width = null, int $height = null, int $quality = null): string
136136
{
137-
if (empty($code)) {
137+
if (!isset($code)) {
138138
throw new AppwriteException('Missing required parameter: "code"');
139139
}
140140

@@ -174,7 +174,7 @@ public function getFlag(string $code, int $width = null, int $height = null, int
174174
*/
175175
public function getImage(string $url, int $width = null, int $height = null): string
176176
{
177-
if (empty($url)) {
177+
if (!isset($url)) {
178178
throw new AppwriteException('Missing required parameter: "url"');
179179
}
180180

@@ -265,7 +265,7 @@ public function getInitials(string $name = null, int $width = null, int $height
265265
*/
266266
public function getQR(string $text, int $size = null, int $margin = null, bool $download = null): string
267267
{
268-
if (empty($text)) {
268+
if (!isset($text)) {
269269
throw new AppwriteException('Missing required parameter: "text"');
270270
}
271271

src/Appwrite/Services/Database.php

+18-18
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ public function listCollections(string $search = null, int $limit = null, int $o
6363
*/
6464
public function createCollection(string $name, array $read, array $write, array $rules): array
6565
{
66-
if (empty($name)) {
66+
if (!isset($name)) {
6767
throw new AppwriteException('Missing required parameter: "name"');
6868
}
6969

70-
if (empty($read)) {
70+
if (!isset($read)) {
7171
throw new AppwriteException('Missing required parameter: "read"');
7272
}
7373

74-
if (empty($write)) {
74+
if (!isset($write)) {
7575
throw new AppwriteException('Missing required parameter: "write"');
7676
}
7777

78-
if (empty($rules)) {
78+
if (!isset($rules)) {
7979
throw new AppwriteException('Missing required parameter: "rules"');
8080
}
8181

@@ -115,7 +115,7 @@ public function createCollection(string $name, array $read, array $write, array
115115
*/
116116
public function getCollection(string $collectionId): array
117117
{
118-
if (empty($collectionId)) {
118+
if (!isset($collectionId)) {
119119
throw new AppwriteException('Missing required parameter: "collectionId"');
120120
}
121121

@@ -142,11 +142,11 @@ public function getCollection(string $collectionId): array
142142
*/
143143
public function updateCollection(string $collectionId, string $name, array $read = null, array $write = null, array $rules = null): array
144144
{
145-
if (empty($collectionId)) {
145+
if (!isset($collectionId)) {
146146
throw new AppwriteException('Missing required parameter: "collectionId"');
147147
}
148148

149-
if (empty($name)) {
149+
if (!isset($name)) {
150150
throw new AppwriteException('Missing required parameter: "name"');
151151
}
152152

@@ -186,7 +186,7 @@ public function updateCollection(string $collectionId, string $name, array $read
186186
*/
187187
public function deleteCollection(string $collectionId): array
188188
{
189-
if (empty($collectionId)) {
189+
if (!isset($collectionId)) {
190190
throw new AppwriteException('Missing required parameter: "collectionId"');
191191
}
192192

@@ -219,7 +219,7 @@ public function deleteCollection(string $collectionId): array
219219
*/
220220
public function listDocuments(string $collectionId, array $filters = null, int $limit = null, int $offset = null, string $orderField = null, string $orderType = null, string $orderCast = null, string $search = null): array
221221
{
222-
if (empty($collectionId)) {
222+
if (!isset($collectionId)) {
223223
throw new AppwriteException('Missing required parameter: "collectionId"');
224224
}
225225

@@ -279,11 +279,11 @@ public function listDocuments(string $collectionId, array $filters = null, int $
279279
*/
280280
public function createDocument(string $collectionId, array $data, array $read = null, array $write = null, string $parentDocument = null, string $parentProperty = null, string $parentPropertyType = null): array
281281
{
282-
if (empty($collectionId)) {
282+
if (!isset($collectionId)) {
283283
throw new AppwriteException('Missing required parameter: "collectionId"');
284284
}
285285

286-
if (empty($data)) {
286+
if (!isset($data)) {
287287
throw new AppwriteException('Missing required parameter: "data"');
288288
}
289289

@@ -332,11 +332,11 @@ public function createDocument(string $collectionId, array $data, array $read =
332332
*/
333333
public function getDocument(string $collectionId, string $documentId): array
334334
{
335-
if (empty($collectionId)) {
335+
if (!isset($collectionId)) {
336336
throw new AppwriteException('Missing required parameter: "collectionId"');
337337
}
338338

339-
if (empty($documentId)) {
339+
if (!isset($documentId)) {
340340
throw new AppwriteException('Missing required parameter: "documentId"');
341341
}
342342

@@ -364,15 +364,15 @@ public function getDocument(string $collectionId, string $documentId): array
364364
*/
365365
public function updateDocument(string $collectionId, string $documentId, array $data, array $read = null, array $write = null): array
366366
{
367-
if (empty($collectionId)) {
367+
if (!isset($collectionId)) {
368368
throw new AppwriteException('Missing required parameter: "collectionId"');
369369
}
370370

371-
if (empty($documentId)) {
371+
if (!isset($documentId)) {
372372
throw new AppwriteException('Missing required parameter: "documentId"');
373373
}
374374

375-
if (empty($data)) {
375+
if (!isset($data)) {
376376
throw new AppwriteException('Missing required parameter: "data"');
377377
}
378378

@@ -410,11 +410,11 @@ public function updateDocument(string $collectionId, string $documentId, array $
410410
*/
411411
public function deleteDocument(string $collectionId, string $documentId): array
412412
{
413-
if (empty($collectionId)) {
413+
if (!isset($collectionId)) {
414414
throw new AppwriteException('Missing required parameter: "collectionId"');
415415
}
416416

417-
if (empty($documentId)) {
417+
if (!isset($documentId)) {
418418
throw new AppwriteException('Missing required parameter: "documentId"');
419419
}
420420

0 commit comments

Comments
 (0)