Skip to content

Commit 211cd78

Browse files
committed
Release candidate for 1.5.x
1 parent 3ee9307 commit 211cd78

File tree

10 files changed

+40
-40
lines changed

10 files changed

+40
-40
lines changed

docs/examples/account/add-authenticator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use Appwrite\Client;
44
use Appwrite\Services\Account;
5-
use Appwrite\Enums\;
5+
use Appwrite\Enums\AuthenticatorType;
66
77
$client = new Client();
88
@@ -14,4 +14,4 @@ $client
1414

1515
$account = new Account($client);
1616

17-
$result = $account->addAuthenticator(::TOTP());
17+
$result = $account->addAuthenticator(AuthenticatorType::TOTP());

docs/examples/account/create2f-a-challenge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use Appwrite\Client;
44
use Appwrite\Services\Account;
5-
use Appwrite\Enums\;
5+
use Appwrite\Enums\AuthenticationFactor;
66
77
$client = new Client();
88
@@ -13,4 +13,4 @@ $client
1313

1414
$account = new Account($client);
1515

16-
$result = $account->create2FAChallenge(::TOTP());
16+
$result = $account->create2FAChallenge(AuthenticationFactor::TOTP());

docs/examples/account/delete-authenticator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use Appwrite\Client;
44
use Appwrite\Services\Account;
5-
use Appwrite\Enums\;
5+
use Appwrite\Enums\AuthenticatorType;
66
77
$client = new Client();
88
@@ -14,4 +14,4 @@ $client
1414

1515
$account = new Account($client);
1616

17-
$result = $account->deleteAuthenticator(::TOTP(), '[OTP]');
17+
$result = $account->deleteAuthenticator(AuthenticatorType::TOTP(), '[OTP]');

docs/examples/account/verify-authenticator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use Appwrite\Client;
44
use Appwrite\Services\Account;
5-
use Appwrite\Enums\;
5+
use Appwrite\Enums\AuthenticatorType;
66
77
$client = new Client();
88
@@ -14,4 +14,4 @@ $client
1414

1515
$account = new Account($client);
1616

17-
$result = $account->verifyAuthenticator(::TOTP(), '[OTP]');
17+
$result = $account->verifyAuthenticator(AuthenticatorType::TOTP(), '[OTP]');

docs/examples/users/delete-authenticator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use Appwrite\Client;
44
use Appwrite\Services\Users;
5-
use Appwrite\Enums\;
5+
use Appwrite\Enums\AuthenticatorType;
66
77
$client = new Client();
88
@@ -14,4 +14,4 @@ $client
1414

1515
$users = new Users($client);
1616

17-
$result = $users->deleteAuthenticator('[USER_ID]', ::TOTP(), '[OTP]');
17+
$result = $users->deleteAuthenticator('[USER_ID]', AuthenticatorType::TOTP(), '[OTP]');

src/Appwrite/Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ class Client
3737
*/
3838
protected $headers = [
3939
'content-type' => '',
40-
'user-agent' => 'AppwritePHPSDK/11.0.0-rc.2 ()',
40+
'user-agent' => 'AppwritePHPSDK/11.0.0-rc.3 ()',
4141
'x-sdk-name'=> 'PHP',
4242
'x-sdk-platform'=> 'server',
4343
'x-sdk-language'=> 'php',
44-
'x-sdk-version'=> '11.0.0-rc.2',
44+
'x-sdk-version'=> '11.0.0-rc.3',
4545
];
4646

4747
/**
4848
* SDK constructor.
4949
*/
5050
public function __construct()
5151
{
52-
$this->headers['X-Appwrite-Response-Format'] = '1.4.0';
52+
$this->headers['X-Appwrite-Response-Format'] = '1.5.0';
5353

5454
}
5555

src/Appwrite/Enums/Factor.php renamed to src/Appwrite/Enums/AuthenticationFactor.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
use JsonSerializable;
66

7-
class Factor implements JsonSerializable
7+
class AuthenticationFactor implements JsonSerializable
88
{
9-
private static Factor $TOTP;
10-
private static Factor $PHONE;
11-
private static Factor $EMAIL;
9+
private static AuthenticationFactor $TOTP;
10+
private static AuthenticationFactor $PHONE;
11+
private static AuthenticationFactor $EMAIL;
1212

1313
private string $value;
1414

@@ -27,24 +27,24 @@ public function jsonSerialize(): string
2727
return $this->value;
2828
}
2929

30-
public static function TOTP(): Factor
30+
public static function TOTP(): AuthenticationFactor
3131
{
3232
if (!isset(self::$TOTP)) {
33-
self::$TOTP = new Factor('totp');
33+
self::$TOTP = new AuthenticationFactor('totp');
3434
}
3535
return self::$TOTP;
3636
}
37-
public static function PHONE(): Factor
37+
public static function PHONE(): AuthenticationFactor
3838
{
3939
if (!isset(self::$PHONE)) {
40-
self::$PHONE = new Factor('phone');
40+
self::$PHONE = new AuthenticationFactor('phone');
4141
}
4242
return self::$PHONE;
4343
}
44-
public static function EMAIL(): Factor
44+
public static function EMAIL(): AuthenticationFactor
4545
{
4646
if (!isset(self::$EMAIL)) {
47-
self::$EMAIL = new Factor('email');
47+
self::$EMAIL = new AuthenticationFactor('email');
4848
}
4949
return self::$EMAIL;
5050
}

src/Appwrite/Enums/Type.php renamed to src/Appwrite/Enums/AuthenticatorType.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
use JsonSerializable;
66

7-
class Type implements JsonSerializable
7+
class AuthenticatorType implements JsonSerializable
88
{
9-
private static Type $TOTP;
9+
private static AuthenticatorType $TOTP;
1010

1111
private string $value;
1212

@@ -25,10 +25,10 @@ public function jsonSerialize(): string
2525
return $this->value;
2626
}
2727

28-
public static function TOTP(): Type
28+
public static function TOTP(): AuthenticatorType
2929
{
3030
if (!isset(self::$TOTP)) {
31-
self::$TOTP = new Type('totp');
31+
self::$TOTP = new AuthenticatorType('totp');
3232
}
3333
return self::$TOTP;
3434
}

src/Appwrite/Services/Account.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use Appwrite\Client;
77
use Appwrite\Service;
88
use Appwrite\InputFile;
9-
use Appwrite\Enums\Factor;
10-
use Appwrite\Enums\Type;
9+
use Appwrite\Enums\AuthenticationFactor;
10+
use Appwrite\Enums\AuthenticatorType;
1111
use Appwrite\Enums\OAuthProvider;
1212

1313
class Account extends Service
@@ -263,12 +263,12 @@ public function updateMFA(bool $mfa): array
263263
/**
264264
* Create 2FA Challenge
265265
*
266-
* @param Factor $factor
266+
* @param AuthenticationFactor $factor
267267
* @throws AppwriteException
268268
* @return array
269269
270270
*/
271-
public function create2FAChallenge(Factor $factor): array
271+
public function create2FAChallenge(AuthenticationFactor $factor): array
272272
{
273273
$apiPath = str_replace([], [], '/account/mfa/challenge');
274274

@@ -341,12 +341,12 @@ public function listFactors(): array
341341
/**
342342
* Add Authenticator
343343
*
344-
* @param Type $type
344+
* @param AuthenticatorType $type
345345
* @throws AppwriteException
346346
* @return array
347347
348348
*/
349-
public function addAuthenticator(Type $type): array
349+
public function addAuthenticator(AuthenticatorType $type): array
350350
{
351351
$apiPath = str_replace(['{type}'], [$type], '/account/mfa/{type}');
352352

@@ -363,13 +363,13 @@ public function addAuthenticator(Type $type): array
363363
/**
364364
* Verify Authenticator
365365
*
366-
* @param Type $type
366+
* @param AuthenticatorType $type
367367
* @param string $otp
368368
* @throws AppwriteException
369369
* @return array
370370
371371
*/
372-
public function verifyAuthenticator(Type $type, string $otp): array
372+
public function verifyAuthenticator(AuthenticatorType $type, string $otp): array
373373
{
374374
$apiPath = str_replace(['{type}'], [$type], '/account/mfa/{type}');
375375

@@ -393,13 +393,13 @@ public function verifyAuthenticator(Type $type, string $otp): array
393393
/**
394394
* Delete Authenticator
395395
*
396-
* @param Type $type
396+
* @param AuthenticatorType $type
397397
* @param string $otp
398398
* @throws AppwriteException
399399
* @return array
400400
401401
*/
402-
public function deleteAuthenticator(Type $type, string $otp): array
402+
public function deleteAuthenticator(AuthenticatorType $type, string $otp): array
403403
{
404404
$apiPath = str_replace(['{type}'], [$type], '/account/mfa/{type}');
405405

src/Appwrite/Services/Users.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Appwrite\Service;
88
use Appwrite\InputFile;
99
use Appwrite\Enums\PasswordHash;
10-
use Appwrite\Enums\Type;
10+
use Appwrite\Enums\AuthenticatorType;
1111
use Appwrite\Enums\MessagingProviderType;
1212

1313
class Users extends Service
@@ -815,13 +815,13 @@ public function listFactors(string $userId): array
815815
* Delete Authenticator
816816
*
817817
* @param string $userId
818-
* @param Type $type
818+
* @param AuthenticatorType $type
819819
* @param string $otp
820820
* @throws AppwriteException
821821
* @return array
822822
823823
*/
824-
public function deleteAuthenticator(string $userId, Type $type, string $otp): array
824+
public function deleteAuthenticator(string $userId, AuthenticatorType $type, string $otp): array
825825
{
826826
$apiPath = str_replace(['{userId}', '{type}'], [$userId, $type], '/users/{userId}/mfa/{type}');
827827

0 commit comments

Comments
 (0)