From 6ab4564db43f7768f60ada7c02e363d6e557c256 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 22 May 2026 12:52:14 +0400 Subject: [PATCH] chore: formatter --- .../RequireLowercase/Update.php | 2 +- .../PasswordStrength/RequireNumber/Update.php | 2 +- .../RequireSpecialChar/Update.php | 2 +- .../RequireUppercase/Update.php | 2 +- .../Modules/Project/Services/Http.php | 202 +++++++++--------- .../Projects/ProjectsConsoleClientTest.php | 48 ++--- 6 files changed, 129 insertions(+), 129 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireLowercase/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireLowercase/Update.php index 359c6e0e43..07c391d832 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireLowercase/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireLowercase/Update.php @@ -49,7 +49,7 @@ class Update extends Action ), ], )) - ->param('enabled', null, new Boolean, 'Whether passwords must include at least one lowercase letter.') + ->param('enabled', null, new Boolean(), 'Whether passwords must include at least one lowercase letter.') ->inject('response') ->inject('dbForPlatform') ->inject('project') diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireNumber/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireNumber/Update.php index 4077df3257..6869a355ed 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireNumber/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireNumber/Update.php @@ -49,7 +49,7 @@ class Update extends Action ), ], )) - ->param('enabled', null, new Boolean, 'Whether passwords must include at least one number.') + ->param('enabled', null, new Boolean(), 'Whether passwords must include at least one number.') ->inject('response') ->inject('dbForPlatform') ->inject('project') diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireSpecialChar/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireSpecialChar/Update.php index a83575ec13..6f70bdb38f 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireSpecialChar/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireSpecialChar/Update.php @@ -49,7 +49,7 @@ class Update extends Action ), ], )) - ->param('enabled', null, new Boolean, 'Whether passwords must include at least one special character.') + ->param('enabled', null, new Boolean(), 'Whether passwords must include at least one special character.') ->inject('response') ->inject('dbForPlatform') ->inject('project') diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireUppercase/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireUppercase/Update.php index 906c52d54d..adc93bcdbc 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireUppercase/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/Policies/PasswordStrength/RequireUppercase/Update.php @@ -49,7 +49,7 @@ class Update extends Action ), ], )) - ->param('enabled', null, new Boolean, 'Whether passwords must include at least one uppercase letter.') + ->param('enabled', null, new Boolean(), 'Whether passwords must include at least one uppercase letter.') ->inject('response') ->inject('dbForPlatform') ->inject('project') diff --git a/src/Appwrite/Platform/Modules/Project/Services/Http.php b/src/Appwrite/Platform/Modules/Project/Services/Http.php index eefb4d770a..7940e5b506 100644 --- a/src/Appwrite/Platform/Modules/Project/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Project/Services/Http.php @@ -112,126 +112,126 @@ class Http extends Service $this->type = Service::TYPE_HTTP; // Hooks - $this->addAction(Init::getName(), new Init); + $this->addAction(Init::getName(), new Init()); // Project - $this->addAction(DeleteProject::getName(), new DeleteProject); - $this->addAction(GetProject::getName(), new GetProject); - $this->addAction(UpdateProjectLabels::getName(), new UpdateProjectLabels); - $this->addAction(UpdateProjectProtocol::getName(), new UpdateProjectProtocol); - $this->addAction(UpdateProjectService::getName(), new UpdateProjectService); + $this->addAction(DeleteProject::getName(), new DeleteProject()); + $this->addAction(GetProject::getName(), new GetProject()); + $this->addAction(UpdateProjectLabels::getName(), new UpdateProjectLabels()); + $this->addAction(UpdateProjectProtocol::getName(), new UpdateProjectProtocol()); + $this->addAction(UpdateProjectService::getName(), new UpdateProjectService()); // SMTP - $this->addAction(UpdateSMTP::getName(), new UpdateSMTP); - $this->addAction(CreateSMTPTest::getName(), new CreateSMTPTest); + $this->addAction(UpdateSMTP::getName(), new UpdateSMTP()); + $this->addAction(CreateSMTPTest::getName(), new CreateSMTPTest()); // Templates - $this->addAction(ListTemplates::getName(), new ListTemplates); - $this->addAction(GetTemplate::getName(), new GetTemplate); - $this->addAction(UpdateTemplate::getName(), new UpdateTemplate); + $this->addAction(ListTemplates::getName(), new ListTemplates()); + $this->addAction(GetTemplate::getName(), new GetTemplate()); + $this->addAction(UpdateTemplate::getName(), new UpdateTemplate()); // Variables - $this->addAction(CreateVariable::getName(), new CreateVariable); - $this->addAction(ListVariables::getName(), new ListVariables); - $this->addAction(GetVariable::getName(), new GetVariable); - $this->addAction(DeleteVariable::getName(), new DeleteVariable); - $this->addAction(UpdateVariable::getName(), new UpdateVariable); + $this->addAction(CreateVariable::getName(), new CreateVariable()); + $this->addAction(ListVariables::getName(), new ListVariables()); + $this->addAction(GetVariable::getName(), new GetVariable()); + $this->addAction(DeleteVariable::getName(), new DeleteVariable()); + $this->addAction(UpdateVariable::getName(), new UpdateVariable()); // Keys - $this->addAction(CreateKey::getName(), new CreateKey); - $this->addAction(CreateEphemeralKey::getName(), new CreateEphemeralKey); - $this->addAction(ListKeys::getName(), new ListKeys); - $this->addAction(GetKey::getName(), new GetKey); - $this->addAction(DeleteKey::getName(), new DeleteKey); - $this->addAction(UpdateKey::getName(), new UpdateKey); + $this->addAction(CreateKey::getName(), new CreateKey()); + $this->addAction(CreateEphemeralKey::getName(), new CreateEphemeralKey()); + $this->addAction(ListKeys::getName(), new ListKeys()); + $this->addAction(GetKey::getName(), new GetKey()); + $this->addAction(DeleteKey::getName(), new DeleteKey()); + $this->addAction(UpdateKey::getName(), new UpdateKey()); // Platforms - $this->addAction(ListPlatforms::getName(), new ListPlatforms); - $this->addAction(GetPlatform::getName(), new GetPlatform); - $this->addAction(CreateWebPlatform::getName(), new CreateWebPlatform); - $this->addAction(CreateApplePlatform::getName(), new CreateApplePlatform); - $this->addAction(CreateAndroidPlatform::getName(), new CreateAndroidPlatform); - $this->addAction(CreateWindowsPlatform::getName(), new CreateWindowsPlatform); - $this->addAction(CreateLinuxPlatform::getName(), new CreateLinuxPlatform); - $this->addAction(UpdateWebPlatform::getName(), new UpdateWebPlatform); - $this->addAction(UpdateApplePlatform::getName(), new UpdateApplePlatform); - $this->addAction(UpdateAndroidPlatform::getName(), new UpdateAndroidPlatform); - $this->addAction(UpdateWindowsPlatform::getName(), new UpdateWindowsPlatform); - $this->addAction(UpdateLinuxPlatform::getName(), new UpdateLinuxPlatform); - $this->addAction(DeletePlatform::getName(), new DeletePlatform); + $this->addAction(ListPlatforms::getName(), new ListPlatforms()); + $this->addAction(GetPlatform::getName(), new GetPlatform()); + $this->addAction(CreateWebPlatform::getName(), new CreateWebPlatform()); + $this->addAction(CreateApplePlatform::getName(), new CreateApplePlatform()); + $this->addAction(CreateAndroidPlatform::getName(), new CreateAndroidPlatform()); + $this->addAction(CreateWindowsPlatform::getName(), new CreateWindowsPlatform()); + $this->addAction(CreateLinuxPlatform::getName(), new CreateLinuxPlatform()); + $this->addAction(UpdateWebPlatform::getName(), new UpdateWebPlatform()); + $this->addAction(UpdateApplePlatform::getName(), new UpdateApplePlatform()); + $this->addAction(UpdateAndroidPlatform::getName(), new UpdateAndroidPlatform()); + $this->addAction(UpdateWindowsPlatform::getName(), new UpdateWindowsPlatform()); + $this->addAction(UpdateLinuxPlatform::getName(), new UpdateLinuxPlatform()); + $this->addAction(DeletePlatform::getName(), new DeletePlatform()); // Mock Phones - $this->addAction(CreateMockPhone::getName(), new CreateMockPhone); - $this->addAction(ListMockPhones::getName(), new ListMockPhones); - $this->addAction(GetMockPhone::getName(), new GetMockPhone); - $this->addAction(UpdateMockPhone::getName(), new UpdateMockPhone); - $this->addAction(DeleteMockPhone::getName(), new DeleteMockPhone); + $this->addAction(CreateMockPhone::getName(), new CreateMockPhone()); + $this->addAction(ListMockPhones::getName(), new ListMockPhones()); + $this->addAction(GetMockPhone::getName(), new GetMockPhone()); + $this->addAction(UpdateMockPhone::getName(), new UpdateMockPhone()); + $this->addAction(DeleteMockPhone::getName(), new DeleteMockPhone()); // Policies - $this->addAction(ListPolicies::getName(), new ListPolicies); - $this->addAction(GetPolicy::getName(), new GetPolicy); - $this->addAction(UpdateMembershipPrivacyPolicy::getName(), new UpdateMembershipPrivacyPolicy); - $this->addAction(UpdatePasswordDictionaryPolicy::getName(), new UpdatePasswordDictionaryPolicy); - $this->addAction(UpdatePasswordHistoryPolicy::getName(), new UpdatePasswordHistoryPolicy); - $this->addAction(UpdatePasswordStrengthMinLengthPolicy::getName(), new UpdatePasswordStrengthMinLengthPolicy); - $this->addAction(UpdatePasswordStrengthRequireUppercasePolicy::getName(), new UpdatePasswordStrengthRequireUppercasePolicy); - $this->addAction(UpdatePasswordStrengthRequireLowercasePolicy::getName(), new UpdatePasswordStrengthRequireLowercasePolicy); - $this->addAction(UpdatePasswordStrengthRequireNumberPolicy::getName(), new UpdatePasswordStrengthRequireNumberPolicy); - $this->addAction(UpdatePasswordStrengthRequireSpecialCharPolicy::getName(), new UpdatePasswordStrengthRequireSpecialCharPolicy); - $this->addAction(UpdatePasswordPersonalDataPolicy::getName(), new UpdatePasswordPersonalDataPolicy); - $this->addAction(UpdateSessionAlertPolicy::getName(), new UpdateSessionAlertPolicy); - $this->addAction(UpdateSessionDurationPolicy::getName(), new UpdateSessionDurationPolicy); - $this->addAction(UpdateSessionInvalidationPolicy::getName(), new UpdateSessionInvalidationPolicy); - $this->addAction(UpdateSessionLimitPolicy::getName(), new UpdateSessionLimitPolicy); - $this->addAction(UpdateUserLimitPolicy::getName(), new UpdateUserLimitPolicy); + $this->addAction(ListPolicies::getName(), new ListPolicies()); + $this->addAction(GetPolicy::getName(), new GetPolicy()); + $this->addAction(UpdateMembershipPrivacyPolicy::getName(), new UpdateMembershipPrivacyPolicy()); + $this->addAction(UpdatePasswordDictionaryPolicy::getName(), new UpdatePasswordDictionaryPolicy()); + $this->addAction(UpdatePasswordHistoryPolicy::getName(), new UpdatePasswordHistoryPolicy()); + $this->addAction(UpdatePasswordStrengthMinLengthPolicy::getName(), new UpdatePasswordStrengthMinLengthPolicy()); + $this->addAction(UpdatePasswordStrengthRequireUppercasePolicy::getName(), new UpdatePasswordStrengthRequireUppercasePolicy()); + $this->addAction(UpdatePasswordStrengthRequireLowercasePolicy::getName(), new UpdatePasswordStrengthRequireLowercasePolicy()); + $this->addAction(UpdatePasswordStrengthRequireNumberPolicy::getName(), new UpdatePasswordStrengthRequireNumberPolicy()); + $this->addAction(UpdatePasswordStrengthRequireSpecialCharPolicy::getName(), new UpdatePasswordStrengthRequireSpecialCharPolicy()); + $this->addAction(UpdatePasswordPersonalDataPolicy::getName(), new UpdatePasswordPersonalDataPolicy()); + $this->addAction(UpdateSessionAlertPolicy::getName(), new UpdateSessionAlertPolicy()); + $this->addAction(UpdateSessionDurationPolicy::getName(), new UpdateSessionDurationPolicy()); + $this->addAction(UpdateSessionInvalidationPolicy::getName(), new UpdateSessionInvalidationPolicy()); + $this->addAction(UpdateSessionLimitPolicy::getName(), new UpdateSessionLimitPolicy()); + $this->addAction(UpdateUserLimitPolicy::getName(), new UpdateUserLimitPolicy()); // Auth Methods - $this->addAction(UpdateAuthMethod::getName(), new UpdateAuthMethod); + $this->addAction(UpdateAuthMethod::getName(), new UpdateAuthMethod()); // OAuth2 - $this->addAction(ListOAuth2Providers::getName(), new ListOAuth2Providers); - $this->addAction(GetOAuth2Provider::getName(), new GetOAuth2Provider); - $this->addAction(UpdateOAuth2GitHub::getName(), new UpdateOAuth2GitHub); - $this->addAction(UpdateOAuth2Discord::getName(), new UpdateOAuth2Discord); - $this->addAction(UpdateOAuth2Figma::getName(), new UpdateOAuth2Figma); - $this->addAction(UpdateOAuth2Dropbox::getName(), new UpdateOAuth2Dropbox); - $this->addAction(UpdateOAuth2Dailymotion::getName(), new UpdateOAuth2Dailymotion); - $this->addAction(UpdateOAuth2Bitbucket::getName(), new UpdateOAuth2Bitbucket); - $this->addAction(UpdateOAuth2Bitly::getName(), new UpdateOAuth2Bitly); - $this->addAction(UpdateOAuth2Box::getName(), new UpdateOAuth2Box); - $this->addAction(UpdateOAuth2Autodesk::getName(), new UpdateOAuth2Autodesk); - $this->addAction(UpdateOAuth2Google::getName(), new UpdateOAuth2Google); - $this->addAction(UpdateOAuth2Zoom::getName(), new UpdateOAuth2Zoom); - $this->addAction(UpdateOAuth2Zoho::getName(), new UpdateOAuth2Zoho); - $this->addAction(UpdateOAuth2Yandex::getName(), new UpdateOAuth2Yandex); - $this->addAction(UpdateOAuth2X::getName(), new UpdateOAuth2X); - $this->addAction(UpdateOAuth2WordPress::getName(), new UpdateOAuth2WordPress); - $this->addAction(UpdateOAuth2Twitch::getName(), new UpdateOAuth2Twitch); - $this->addAction(UpdateOAuth2Stripe::getName(), new UpdateOAuth2Stripe); - $this->addAction(UpdateOAuth2Spotify::getName(), new UpdateOAuth2Spotify); - $this->addAction(UpdateOAuth2Slack::getName(), new UpdateOAuth2Slack); - $this->addAction(UpdateOAuth2Podio::getName(), new UpdateOAuth2Podio); - $this->addAction(UpdateOAuth2Notion::getName(), new UpdateOAuth2Notion); - $this->addAction(UpdateOAuth2Salesforce::getName(), new UpdateOAuth2Salesforce); - $this->addAction(UpdateOAuth2Yahoo::getName(), new UpdateOAuth2Yahoo); - $this->addAction(UpdateOAuth2Linkedin::getName(), new UpdateOAuth2Linkedin); - $this->addAction(UpdateOAuth2Disqus::getName(), new UpdateOAuth2Disqus); - $this->addAction(UpdateOAuth2Amazon::getName(), new UpdateOAuth2Amazon); - $this->addAction(UpdateOAuth2Etsy::getName(), new UpdateOAuth2Etsy); - $this->addAction(UpdateOAuth2Facebook::getName(), new UpdateOAuth2Facebook); - $this->addAction(UpdateOAuth2Tradeshift::getName(), new UpdateOAuth2Tradeshift); - $this->addAction(UpdateOAuth2TradeshiftSandbox::getName(), new UpdateOAuth2TradeshiftSandbox); - $this->addAction(UpdateOAuth2Paypal::getName(), new UpdateOAuth2Paypal); - $this->addAction(UpdateOAuth2PaypalSandbox::getName(), new UpdateOAuth2PaypalSandbox); - $this->addAction(UpdateOAuth2Gitlab::getName(), new UpdateOAuth2Gitlab); - $this->addAction(UpdateOAuth2Authentik::getName(), new UpdateOAuth2Authentik); - $this->addAction(UpdateOAuth2Auth0::getName(), new UpdateOAuth2Auth0); - $this->addAction(UpdateOAuth2FusionAuth::getName(), new UpdateOAuth2FusionAuth); - $this->addAction(UpdateOAuth2Keycloak::getName(), new UpdateOAuth2Keycloak); - $this->addAction(UpdateOAuth2Oidc::getName(), new UpdateOAuth2Oidc); - $this->addAction(UpdateOAuth2Okta::getName(), new UpdateOAuth2Okta); - $this->addAction(UpdateOAuth2Kick::getName(), new UpdateOAuth2Kick); - $this->addAction(UpdateOAuth2Apple::getName(), new UpdateOAuth2Apple); - $this->addAction(UpdateOAuth2Microsoft::getName(), new UpdateOAuth2Microsoft); + $this->addAction(ListOAuth2Providers::getName(), new ListOAuth2Providers()); + $this->addAction(GetOAuth2Provider::getName(), new GetOAuth2Provider()); + $this->addAction(UpdateOAuth2GitHub::getName(), new UpdateOAuth2GitHub()); + $this->addAction(UpdateOAuth2Discord::getName(), new UpdateOAuth2Discord()); + $this->addAction(UpdateOAuth2Figma::getName(), new UpdateOAuth2Figma()); + $this->addAction(UpdateOAuth2Dropbox::getName(), new UpdateOAuth2Dropbox()); + $this->addAction(UpdateOAuth2Dailymotion::getName(), new UpdateOAuth2Dailymotion()); + $this->addAction(UpdateOAuth2Bitbucket::getName(), new UpdateOAuth2Bitbucket()); + $this->addAction(UpdateOAuth2Bitly::getName(), new UpdateOAuth2Bitly()); + $this->addAction(UpdateOAuth2Box::getName(), new UpdateOAuth2Box()); + $this->addAction(UpdateOAuth2Autodesk::getName(), new UpdateOAuth2Autodesk()); + $this->addAction(UpdateOAuth2Google::getName(), new UpdateOAuth2Google()); + $this->addAction(UpdateOAuth2Zoom::getName(), new UpdateOAuth2Zoom()); + $this->addAction(UpdateOAuth2Zoho::getName(), new UpdateOAuth2Zoho()); + $this->addAction(UpdateOAuth2Yandex::getName(), new UpdateOAuth2Yandex()); + $this->addAction(UpdateOAuth2X::getName(), new UpdateOAuth2X()); + $this->addAction(UpdateOAuth2WordPress::getName(), new UpdateOAuth2WordPress()); + $this->addAction(UpdateOAuth2Twitch::getName(), new UpdateOAuth2Twitch()); + $this->addAction(UpdateOAuth2Stripe::getName(), new UpdateOAuth2Stripe()); + $this->addAction(UpdateOAuth2Spotify::getName(), new UpdateOAuth2Spotify()); + $this->addAction(UpdateOAuth2Slack::getName(), new UpdateOAuth2Slack()); + $this->addAction(UpdateOAuth2Podio::getName(), new UpdateOAuth2Podio()); + $this->addAction(UpdateOAuth2Notion::getName(), new UpdateOAuth2Notion()); + $this->addAction(UpdateOAuth2Salesforce::getName(), new UpdateOAuth2Salesforce()); + $this->addAction(UpdateOAuth2Yahoo::getName(), new UpdateOAuth2Yahoo()); + $this->addAction(UpdateOAuth2Linkedin::getName(), new UpdateOAuth2Linkedin()); + $this->addAction(UpdateOAuth2Disqus::getName(), new UpdateOAuth2Disqus()); + $this->addAction(UpdateOAuth2Amazon::getName(), new UpdateOAuth2Amazon()); + $this->addAction(UpdateOAuth2Etsy::getName(), new UpdateOAuth2Etsy()); + $this->addAction(UpdateOAuth2Facebook::getName(), new UpdateOAuth2Facebook()); + $this->addAction(UpdateOAuth2Tradeshift::getName(), new UpdateOAuth2Tradeshift()); + $this->addAction(UpdateOAuth2TradeshiftSandbox::getName(), new UpdateOAuth2TradeshiftSandbox()); + $this->addAction(UpdateOAuth2Paypal::getName(), new UpdateOAuth2Paypal()); + $this->addAction(UpdateOAuth2PaypalSandbox::getName(), new UpdateOAuth2PaypalSandbox()); + $this->addAction(UpdateOAuth2Gitlab::getName(), new UpdateOAuth2Gitlab()); + $this->addAction(UpdateOAuth2Authentik::getName(), new UpdateOAuth2Authentik()); + $this->addAction(UpdateOAuth2Auth0::getName(), new UpdateOAuth2Auth0()); + $this->addAction(UpdateOAuth2FusionAuth::getName(), new UpdateOAuth2FusionAuth()); + $this->addAction(UpdateOAuth2Keycloak::getName(), new UpdateOAuth2Keycloak()); + $this->addAction(UpdateOAuth2Oidc::getName(), new UpdateOAuth2Oidc()); + $this->addAction(UpdateOAuth2Okta::getName(), new UpdateOAuth2Okta()); + $this->addAction(UpdateOAuth2Kick::getName(), new UpdateOAuth2Kick()); + $this->addAction(UpdateOAuth2Apple::getName(), new UpdateOAuth2Apple()); + $this->addAction(UpdateOAuth2Microsoft::getName(), new UpdateOAuth2Microsoft()); } } diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 85c4b5d4e0..dba60c6dcb 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -4472,7 +4472,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId']; /** Create a second key with an expiry for query testing */ - $expireDate = DateTime::addSeconds(new \DateTime, 3600); + $expireDate = DateTime::addSeconds(new \DateTime(), 3600); $response = $this->client->call(Client::METHOD_POST, '/projects/'.$id.'/keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -4545,7 +4545,7 @@ class ProjectsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'queries' => [ - Query::lessThan('expire', (new \DateTime)->format('Y-m-d H:i:s'))->toString(), + Query::lessThan('expire', (new \DateTime())->format('Y-m-d H:i:s'))->toString(), ], ]); @@ -4558,7 +4558,7 @@ class ProjectsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'queries' => [ - Query::greaterThan('expire', (new \DateTime)->format('Y-m-d H:i:s'))->toString(), + Query::greaterThan('expire', (new \DateTime())->format('Y-m-d H:i:s'))->toString(), ], ]); @@ -4648,7 +4648,7 @@ class ProjectsConsoleClientTest extends Scope 'keyId' => ID::unique(), 'name' => 'Key Test', 'scopes' => ['users.write'], - 'expire' => DateTime::addSeconds(new \DateTime, 3600), + 'expire' => DateTime::addSeconds(new \DateTime(), 3600), ]); $response = $this->client->call(Client::METHOD_POST, '/users', [ @@ -4692,7 +4692,7 @@ class ProjectsConsoleClientTest extends Scope 'keyId' => ID::unique(), 'name' => 'Key Test', 'scopes' => ['health.read'], - 'expire' => DateTime::addSeconds(new \DateTime, -3600), + 'expire' => DateTime::addSeconds(new \DateTime(), -3600), ]); $response = $this->client->call(Client::METHOD_GET, '/health', [ @@ -4734,7 +4734,7 @@ class ProjectsConsoleClientTest extends Scope 'keyId' => ID::unique(), 'name' => 'Key Test', 'scopes' => ['teams.read'], - 'expire' => DateTime::addSeconds(new \DateTime, 3600), + 'expire' => DateTime::addSeconds(new \DateTime(), 3600), ]); $response = $this->client->call(Client::METHOD_GET, '/users', [ @@ -4768,7 +4768,7 @@ class ProjectsConsoleClientTest extends Scope 'keyId' => ID::unique(), 'name' => 'Key Test', 'scopes' => ['health.read'], - 'expire' => DateTime::addSeconds(new \DateTime, 3600), + 'expire' => DateTime::addSeconds(new \DateTime(), 3600), ]); $response = $this->client->call(Client::METHOD_GET, '/health', [ @@ -4792,7 +4792,7 @@ class ProjectsConsoleClientTest extends Scope ], $this->getHeaders()), [ 'name' => 'Key Test Update', 'scopes' => ['users.read', 'users.write', 'collections.read', 'tables.read'], - 'expire' => DateTime::addSeconds(new \DateTime, 360), + 'expire' => DateTime::addSeconds(new \DateTime(), 360), ]); $this->assertEquals(200, $response['headers']['status-code']); @@ -6343,7 +6343,7 @@ class ProjectsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); $this->assertEquals(201, $response['headers']['status-code']); @@ -6359,7 +6359,7 @@ class ProjectsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); $this->assertEquals(201, $response['headers']['status-code']); @@ -6400,14 +6400,14 @@ class ProjectsConsoleClientTest extends Scope $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); /** Create devKey 2 */ $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); /** List all dev keys */ @@ -6448,7 +6448,7 @@ class ProjectsConsoleClientTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::lessThan('expire', (new \DateTime)->format('Y-m-d H:i:s'))->toString()], + 'queries' => [Query::lessThan('expire', (new \DateTime())->format('Y-m-d H:i:s'))->toString()], ]); $this->assertEquals(200, $response['headers']['status-code']); @@ -6487,7 +6487,7 @@ class ProjectsConsoleClientTest extends Scope $devKey = $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); $response = $this->client->call(Client::METHOD_GET, '/projects/'.$projectId.'/dev-keys/'.$devKey['$id'], array_merge([ @@ -6529,7 +6529,7 @@ class ProjectsConsoleClientTest extends Scope $devKey = $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); /** Use dev key with python sdk */ @@ -6584,7 +6584,7 @@ class ProjectsConsoleClientTest extends Scope $devKey = $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); $provider = 'mock'; @@ -6628,7 +6628,7 @@ class ProjectsConsoleClientTest extends Scope $location = $response['headers']['location']; - $locationClient = new Client; + $locationClient = new Client(); $locationClient->setEndpoint(''); $locationClient->addHeader('x-appwrite-dev-key', $devKey['secret']); @@ -6890,7 +6890,7 @@ class ProjectsConsoleClientTest extends Scope $devKey = $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); $origin = 'http://example.com'; @@ -7006,7 +7006,7 @@ class ProjectsConsoleClientTest extends Scope $devKey = $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); /** @@ -7051,7 +7051,7 @@ class ProjectsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, -3600), + 'expire' => DateTime::addSeconds(new \DateTime(), -3600), ]); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ @@ -7070,7 +7070,7 @@ class ProjectsConsoleClientTest extends Scope $devKey = $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test Expire 5 seconds', - 'expire' => DateTime::addSeconds(new \DateTime, 5), + 'expire' => DateTime::addSeconds(new \DateTime(), 5), ]); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ @@ -7108,7 +7108,7 @@ class ProjectsConsoleClientTest extends Scope $devKey = $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); $response = $this->client->call(Client::METHOD_PUT, '/projects/'.$projectId.'/dev-keys/'.$devKey['$id'], array_merge([ @@ -7116,7 +7116,7 @@ class ProjectsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Key Test Update', - 'expire' => DateTime::addSeconds(new \DateTime, 360), + 'expire' => DateTime::addSeconds(new \DateTime(), 360), ]); $this->assertEquals(200, $response['headers']['status-code']); @@ -7151,7 +7151,7 @@ class ProjectsConsoleClientTest extends Scope $devKey = $this->setupDevKey([ 'projectId' => $projectId, 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime, 36000), + 'expire' => DateTime::addSeconds(new \DateTime(), 36000), ]); $response = $this->client->call(Client::METHOD_DELETE, '/projects/'.$projectId.'/dev-keys/'.$devKey['$id'], array_merge([