From f2ba319e6e0b5c391e08b6194116f4bc6336308e Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Thu, 13 Mar 2025 12:16:17 +0530 Subject: [PATCH] Improve params readability --- .../Modules/Console/Http/Resources/Get.php | 8 +++-- .../Functions/Http/Deployments/Create.php | 17 +++++++++-- .../Functions/Http/Deployments/Delete.php | 11 +++++-- .../Http/Deployments/Download/Get.php | 14 +++++++-- .../Http/Deployments/Duplicate/Create.php | 12 ++++++-- .../Functions/Http/Deployments/Get.php | 8 +++-- .../Http/Deployments/Status/Update.php | 10 +++++-- .../Http/Deployments/Template/Create.php | 22 +++++++++++--- .../Functions/Http/Deployments/Vcs/Create.php | 16 ++++++++-- .../Functions/Http/Deployments/XList.php | 9 ++++-- .../Functions/Http/Executions/Create.php | 21 +++++++++++-- .../Functions/Http/Executions/Delete.php | 10 +++++-- .../Modules/Functions/Http/Executions/Get.php | 8 +++-- .../Functions/Http/Executions/XList.php | 8 +++-- .../Functions/Http/Functions/Create.php | 28 +++++++++++++++-- .../Functions/Http/Functions/Delete.php | 10 +++++-- .../Http/Functions/Deployment/Update.php | 11 +++++-- .../Modules/Functions/Http/Functions/Get.php | 7 +++-- .../Functions/Http/Functions/Update.php | 30 +++++++++++++++++-- .../Functions/Http/Functions/XList.php | 8 +++-- .../Functions/Http/Variables/Create.php | 11 +++++-- .../Functions/Http/Variables/Delete.php | 9 ++++-- .../Functions/Http/Variables/Update.php | 12 ++++++-- .../Modules/Sites/Http/Deployments/Create.php | 19 ++++++++++-- .../Modules/Sites/Http/Deployments/Delete.php | 11 +++++-- .../Sites/Http/Deployments/Download/Get.php | 12 ++++++-- .../Http/Deployments/Duplicate/Create.php | 13 ++++++-- .../Sites/Http/Deployments/Status/Update.php | 10 +++++-- .../Http/Deployments/Template/Create.php | 22 +++++++++++--- .../Sites/Http/Deployments/Vcs/Create.php | 16 ++++++++-- .../Modules/Sites/Http/Sites/Create.php | 26 ++++++++++++++-- .../Modules/Sites/Http/Sites/Delete.php | 9 ++++-- .../Sites/Http/Sites/Deployment/Update.php | 11 +++++-- .../Modules/Sites/Http/Templates/XList.php | 9 ++++-- .../Platform/Modules/Sites/Http/Usage/Get.php | 8 +++-- .../Modules/Sites/Http/Variables/Update.php | 11 +++++-- .../Modules/Sites/Http/Variables/XList.php | 7 +++-- 37 files changed, 405 insertions(+), 79 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php index e9304f6afd..ec1c195d61 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php @@ -59,8 +59,12 @@ class Get extends Action ->callback([$this, 'action']); } - public function action(string $value, string $type, Response $response, Database $dbForPlatform) - { + public function action( + string $value, + string $type, + Response $response, + Database $dbForPlatform + ) { if ($type === 'rules') { $validator = new Domain($value); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php index 580959589b..69ebb6f68c 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php @@ -87,8 +87,21 @@ class Create extends Action ->callback([$this, 'action']); } - public function action(string $functionId, ?string $entrypoint, ?string $commands, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceForFunctions, Device $deviceForLocal, Build $queueForBuilds) - { + public function action( + string $functionId, + ?string $entrypoint, + ?string $commands, + mixed $code, + mixed $activate, + Request $request, + Response $response, + Database $dbForProject, + Event $queueForEvents, + Document $project, + Device $deviceForFunctions, + Device $deviceForLocal, + Build $queueForBuilds + ) { $activate = \strval($activate) === 'true' || \strval($activate) === '1'; $function = $dbForProject->getDocument('functions', $functionId); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php index 81474742ce..ec4a90f426 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php @@ -63,8 +63,15 @@ class Delete extends Action ->callback([$this, 'action']); } - public function action(string $functionId, string $deploymentId, Response $response, Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents, Device $deviceForFunctions) - { + public function action( + string $functionId, + string $deploymentId, + Response $response, + Database $dbForProject, + DeleteEvent $queueForDeletes, + Event $queueForEvents, + Device $deviceForFunctions + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { throw new Exception(Exception::FUNCTION_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php index 4fa279a3d7..94d86a2647 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php @@ -31,7 +31,7 @@ class Get extends Action $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) ->setHttpPath('/v1/functions/:functionId/deployments/:deploymentId/download') - ->httpAlias('/v1/functions/:functionId/deployments/:deploymentId/build/download', [ 'type' => 'output' ]) + ->httpAlias('/v1/functions/:functionId/deployments/:deploymentId/build/download', ['type' => 'output']) ->groups(['api', 'functions']) ->desc('Download deployment') ->label('scope', 'functions.read') @@ -63,8 +63,16 @@ class Get extends Action ->callback([$this, 'action']); } - public function action(string $functionId, string $deploymentId, string $type, Response $response, Request $request, Database $dbForProject, Device $deviceForFunctions, Device $deviceForBuilds) - { + public function action( + string $functionId, + string $deploymentId, + string $type, + Response $response, + Request $request, + Database $dbForProject, + Device $deviceForFunctions, + Device $deviceForBuilds + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { throw new Exception(Exception::FUNCTION_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php index b942ba9ab7..52c992880a 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php @@ -64,8 +64,16 @@ class Create extends Action ->callback([$this, 'action']); } - public function action(string $functionId, string $deploymentId, string $buildId, Response $response, Database $dbForProject, Event $queueForEvents, Build $queueForBuilds, Device $deviceForFunctions) - { + public function action( + string $functionId, + string $deploymentId, + string $buildId, + Response $response, + Database $dbForProject, + Event $queueForEvents, + Build $queueForBuilds, + Device $deviceForFunctions + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php index 8e58433e7c..9a532fcb86 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php @@ -51,8 +51,12 @@ class Get extends Action ->callback([$this, 'action']); } - public function action(string $functionId, string $deploymentId, Response $response, Database $dbForProject) - { + public function action( + string $functionId, + string $deploymentId, + Response $response, + Database $dbForProject + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php index 6c8cacdcfd..6d5cc145c9 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php @@ -61,8 +61,14 @@ class Update extends Action ->callback([$this, 'action']); } - public function action(string $functionId, string $deploymentId, Response $response, Database $dbForProject, Document $project, Event $queueForEvents) - { + public function action( + string $functionId, + string $deploymentId, + Response $response, + Database $dbForProject, + Document $project, + Event $queueForEvents + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php index 1f6fa364f3..9d48c1c112 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php @@ -77,8 +77,22 @@ class Create extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $repository, string $owner, string $rootDirectory, string $version, bool $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Event $queueForEvents, Document $project, Build $queueForBuilds, GitHub $github) - { + public function action( + string $functionId, + string $repository, + string $owner, + string $rootDirectory, + string $version, + bool $activate, + Request $request, + Response $response, + Database $dbForProject, + Database $dbForPlatform, + Event $queueForEvents, + Document $project, + Build $queueForBuilds, + GitHub $github + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { @@ -108,8 +122,8 @@ class Create extends Base ); $queueForEvents - ->setParam('functionId', $function->getId()) - ->setParam('deploymentId', $deployment->getId()); + ->setParam('functionId', $function->getId()) + ->setParam('deploymentId', $deployment->getId()); $response ->setStatusCode(Response::STATUS_CODE_ACCEPTED) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php index 53c4dcb8c9..a47730c053 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php @@ -74,8 +74,20 @@ class Create extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $type, string $reference, bool $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Event $queueForEvents, Build $queueForBuilds, GitHub $github) - { + public function action( + string $functionId, + string $type, + string $reference, + bool $activate, + Request $request, + Response $response, + Database $dbForProject, + Database $dbForPlatform, + Document $project, + Event $queueForEvents, + Build $queueForBuilds, + GitHub $github + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php index a416001e2f..85247e63e4 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php @@ -58,8 +58,13 @@ class XList extends Action ->callback([$this, 'action']); } - public function action(string $functionId, array $queries, string $search, Response $response, Database $dbForProject) - { + public function action( + string $functionId, + array $queries, + string $search, + Response $response, + Database $dbForProject + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php index dd580bc365..2e47c04276 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php @@ -96,8 +96,25 @@ class Create extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $body, mixed $async, string $path, string $method, mixed $headers, ?string $scheduledAt, Response $response, Request $request, Document $project, Database $dbForProject, Database $dbForPlatform, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb) - { + public function action( + string $functionId, + string $body, + mixed $async, + string $path, + string $method, + mixed $headers, + ?string $scheduledAt, + Response $response, + Request $request, + Document $project, + Database $dbForProject, + Database $dbForPlatform, + Document $user, + Event $queueForEvents, + StatsUsage $queueForStatsUsage, + Func $queueForFunctions, + Reader $geodb + ) { $async = \strval($async) === 'true' || \strval($async) === '1'; if (!$async && !is_null($scheduledAt)) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php index 7b9fd77a25..b22adb0565 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php @@ -64,8 +64,14 @@ class Delete extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $executionId, Response $response, Database $dbForProject, Database $dbForPlatform, Event $queueForEvents) - { + public function action( + string $functionId, + string $executionId, + Response $response, + Database $dbForProject, + Database $dbForPlatform, + Event $queueForEvents + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php index da58d86414..d0fee863d7 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php @@ -54,8 +54,12 @@ class Get extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $executionId, Response $response, Database $dbForProject) - { + public function action( + string $functionId, + string $executionId, + Response $response, + Database $dbForProject + ) { $function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php index 7f133ee548..be1e16225c 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php @@ -59,8 +59,12 @@ class XList extends Base ->callback([$this, 'action']); } - public function action(string $functionId, array $queries, Response $response, Database $dbForProject) - { + public function action( + string $functionId, + array $queries, + Response $response, + Database $dbForProject + ) { $function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index b458645eb7..552d9655f1 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -100,8 +100,32 @@ class Create extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Response $response, Database $dbForProject, callable $timelimit, Document $project, Event $queueForEvents, Database $dbForPlatform) - { + public function action( + string $functionId, + string $name, + string $runtime, + array $execute, + array $events, + string $schedule, + int $timeout, + bool $enabled, + bool $logging, + string $entrypoint, + string $commands, + array $scopes, + string $installationId, + string $providerRepositoryId, + string $providerBranch, + bool $providerSilentMode, + string $providerRootDirectory, + string $specification, + Response $response, + Database $dbForProject, + callable $timelimit, + Document $project, + Event $queueForEvents, + Database $dbForPlatform + ) { // Temporary abuse check $abuseCheck = function () use ($project, $timelimit, $response) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php index 92c99133b7..40112756ea 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php @@ -63,8 +63,14 @@ class Delete extends Base ->callback([$this, 'action']); } - public function action(string $functionId, Response $response, Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents, Database $dbForPlatform) - { + public function action( + string $functionId, + Response $response, + Database $dbForProject, + DeleteEvent $queueForDeletes, + Event $queueForEvents, + Database $dbForPlatform + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php index 450f0fec04..42608ab47e 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php @@ -64,8 +64,15 @@ class Update extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $deploymentId, Document $project, Response $response, Database $dbForProject, Event $queueForEvents, Database $dbForPlatform) - { + public function action( + string $functionId, + string $deploymentId, + Document $project, + Response $response, + Database $dbForProject, + Event $queueForEvents, + Database $dbForPlatform + ) { $function = $dbForProject->getDocument('functions', $functionId); $deployment = $dbForProject->getDocument('deployments', $deploymentId); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php index 77c673b614..fb58e9b2d1 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php @@ -51,8 +51,11 @@ class Get extends Base ->callback([$this, 'action']); } - public function action(string $functionId, Response $response, Database $dbForProject) - { + public function action( + string $functionId, + Response $response, + Database $dbForProject + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php index d1f5f8eaf7..d1714685d8 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php @@ -106,8 +106,34 @@ class Update extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForPlatform, GitHub $github) - { + public function action( + string $functionId, + string $name, + string $runtime, + array $execute, + array $events, + string $schedule, + int $timeout, + bool $enabled, + bool $logging, + string $entrypoint, + string $commands, + array $scopes, + string $installationId, + ?string $providerRepositoryId, + string $providerBranch, + bool $providerSilentMode, + string $providerRootDirectory, + string $specification, + Request $request, + Response $response, + Database $dbForProject, + Document $project, + Event $queueForEvents, + Build $queueForBuilds, + Database $dbForPlatform, + GitHub $github + ) { // TODO: If only branch changes, re-deploy $function = $dbForProject->getDocument('functions', $functionId); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php index 4b98f409fe..6bcbb6cfbe 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php @@ -57,8 +57,12 @@ class XList extends Base ->callback([$this, 'action']); } - public function action(array $queries, string $search, Response $response, Database $dbForProject) - { + public function action( + array $queries, + string $search, + Response $response, + Database $dbForProject + ) { try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php index 5cfd5e8a95..97a5801216 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php @@ -66,8 +66,15 @@ class Create extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $key, string $value, bool $secret, Response $response, Database $dbForProject, Database $dbForPlatform) - { + public function action( + string $functionId, + string $key, + string $value, + bool $secret, + Response $response, + Database $dbForProject, + Database $dbForPlatform + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php index 996e0026ac..13bc8c41b6 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php @@ -59,8 +59,13 @@ class Delete extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $variableId, Response $response, Database $dbForProject, Database $dbForPlatform) - { + public function action( + string $functionId, + string $variableId, + Response $response, + Database $dbForProject, + Database $dbForPlatform + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php index 5cd277ca8f..7334ff6a4e 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php @@ -63,8 +63,16 @@ class Update extends Base ->callback([$this, 'action']); } - public function action(string $functionId, string $variableId, string $key, ?string $value, ?bool $secret, Response $response, Database $dbForProject, Database $dbForPlatform) - { + public function action( + string $functionId, + string $variableId, + string $key, + ?string $value, + ?bool $secret, + Response $response, + Database $dbForProject, + Database $dbForPlatform + ) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php index 2da5e00ca2..605f310534 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php @@ -86,8 +86,23 @@ class Create extends Action ->callback([$this, 'action']); } - public function action(string $siteId, ?string $installCommand, ?string $buildCommand, ?string $outputDirectory, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Event $queueForEvents, Device $deviceForSites, Device $deviceForLocal, Build $queueForBuilds) - { + public function action( + string $siteId, + ?string $installCommand, + ?string $buildCommand, + ?string $outputDirectory, + mixed $code, + mixed $activate, + Request $request, + Response $response, + Database $dbForProject, + Database $dbForPlatform, + Document $project, + Event $queueForEvents, + Device $deviceForSites, + Device $deviceForLocal, + Build $queueForBuilds + ) { $activate = \strval($activate) === 'true' || \strval($activate) === '1'; $site = $dbForProject->getDocument('sites', $siteId); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php index 458d758d93..ab3b17c8bd 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php @@ -63,8 +63,15 @@ class Delete extends Action ->callback([$this, 'action']); } - public function action(string $siteId, string $deploymentId, Response $response, Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents, Device $deviceForSites) - { + public function action( + string $siteId, + string $deploymentId, + Response $response, + Database $dbForProject, + DeleteEvent $queueForDeletes, + Event $queueForEvents, + Device $deviceForSites + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { throw new Exception(Exception::SITE_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php index 6d969f883f..77301a2aa1 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php @@ -62,8 +62,16 @@ class Get extends Action ->callback([$this, 'action']); } - public function action(string $siteId, string $deploymentId, string $type, Response $response, Request $request, Database $dbForProject, Device $deviceForSites, Device $deviceForBuilds) - { + public function action( + string $siteId, + string $deploymentId, + string $type, + Response $response, + Request $request, + Database $dbForProject, + Device $deviceForSites, + Device $deviceForBuilds + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { throw new Exception(Exception::SITE_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php index dff506ad6b..bc5bf94061 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php @@ -65,8 +65,17 @@ class Create extends Action ->callback([$this, 'action']); } - public function action(string $siteId, string $deploymentId, Response $response, Document $project, Database $dbForProject, Database $dbForPlatform, Event $queueForEvents, Build $queueForBuilds, Device $deviceForSites) - { + public function action( + string $siteId, + string $deploymentId, + Response $response, + Document $project, + Database $dbForProject, + Database $dbForPlatform, + Event $queueForEvents, + Build $queueForBuilds, + Device $deviceForSites + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php index 632ad51c9b..0361c1bc9c 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php @@ -59,8 +59,14 @@ class Update extends Action ->callback([$this, 'action']); } - public function action(string $siteId, string $deploymentId, Response $response, Database $dbForProject, Document $project, Event $queueForEvents) - { + public function action( + string $siteId, + string $deploymentId, + Response $response, + Database $dbForProject, + Document $project, + Event $queueForEvents + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php index 75b67004b2..6400b2bb3a 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php @@ -79,8 +79,22 @@ class Create extends Base ->callback([$this, 'action']); } - public function action(string $siteId, string $repository, string $owner, string $rootDirectory, string $version, bool $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Event $queueForEvents, Build $queueForBuilds, GitHub $github) - { + public function action( + string $siteId, + string $repository, + string $owner, + string $rootDirectory, + string $version, + bool $activate, + Request $request, + Response $response, + Database $dbForProject, + Database $dbForPlatform, + Document $project, + Event $queueForEvents, + Build $queueForBuilds, + GitHub $github + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { @@ -111,8 +125,8 @@ class Create extends Base ); $queueForEvents - ->setParam('siteId', $site->getId()) - ->setParam('deploymentId', $deployment->getId()); + ->setParam('siteId', $site->getId()) + ->setParam('deploymentId', $deployment->getId()); $response ->setStatusCode(Response::STATUS_CODE_ACCEPTED) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php index d4e256c570..52dc378b48 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php @@ -74,8 +74,20 @@ class Create extends Base ->callback([$this, 'action']); } - public function action(string $siteId, string $type, string $reference, bool $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Event $queueForEvents, Build $queueForBuilds, GitHub $github) - { + public function action( + string $siteId, + string $type, + string $reference, + bool $activate, + Request $request, + Response $response, + Database $dbForProject, + Database $dbForPlatform, + Document $project, + Event $queueForEvents, + Build $queueForBuilds, + GitHub $github + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php index b3c0c9fb47..2762e63d65 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php @@ -91,8 +91,30 @@ class Create extends Base ->callback([$this, 'action']); } - public function action(string $siteId, string $name, string $framework, bool $enabled, int $timeout, string $installCommand, string $buildCommand, string $outputDirectory, string $buildRuntime, string $adapter, string $installationId, string $fallbackFile, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Database $dbForPlatform) - { + public function action( + string $siteId, + string $name, + string $framework, + bool $enabled, + int $timeout, + string $installCommand, + string $buildCommand, + string $outputDirectory, + string $buildRuntime, + string $adapter, + string $installationId, + string $fallbackFile, + string $providerRepositoryId, + string $providerBranch, + bool $providerSilentMode, + string $providerRootDirectory, + string $specification, + Response $response, + Database $dbForProject, + Document $project, + Event $queueForEvents, + Database $dbForPlatform + ) { if (!empty($adapter)) { $configFramework = Config::getParam('frameworks')[$framework] ?? []; $adapters = \array_keys($configFramework['adapters'] ?? []); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php index b68b9ec58a..68573d6674 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php @@ -60,8 +60,13 @@ class Delete extends Base ->callback([$this, 'action']); } - public function action(string $siteId, Response $response, Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents) - { + public function action( + string $siteId, + Response $response, + Database $dbForProject, + DeleteEvent $queueForDeletes, + Event $queueForEvents + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php index f9012da378..9498a3f799 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php @@ -61,8 +61,15 @@ class Update extends Base ->callback([$this, 'action']); } - public function action(string $siteId, string $deploymentId, Document $project, Response $response, Database $dbForProject, Event $queueForEvents, Database $dbForPlatform) - { + public function action( + string $siteId, + string $deploymentId, + Document $project, + Response $response, + Database $dbForProject, + Event $queueForEvents, + Database $dbForPlatform + ) { $site = $dbForProject->getDocument('sites', $siteId); $deployment = $dbForProject->getDocument('deployments', $deploymentId); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php index 9bf4e09823..32205b48a7 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php @@ -55,8 +55,13 @@ class XList extends Base ->callback([$this, 'action']); } - public function action(array $frameworks, array $usecases, int $limit, int $offset, Response $response) - { + public function action( + array $frameworks, + array $usecases, + int $limit, + int $offset, + Response $response + ) { $templates = Config::getParam('templates-site', []); if (!empty($frameworks)) { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php index f33ac17f5b..3269062d6d 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php @@ -57,8 +57,12 @@ class Get extends Base ->callback([$this, 'action']); } - public function action(string $siteId, string $range, Response $response, Database $dbForProject) - { + public function action( + string $siteId, + string $range, + Response $response, + Database $dbForProject + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php index d64af650e3..bc4ba7f62c 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php @@ -60,8 +60,15 @@ class Update extends Base ->callback([$this, 'action']); } - public function action(string $siteId, string $variableId, string $key, ?string $value, ?bool $secret, Response $response, Database $dbForProject) - { + public function action( + string $siteId, + string $variableId, + string $key, + ?string $value, + ?bool $secret, + Response $response, + Database $dbForProject + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php index 9d0a55a81c..2cc3fe8e54 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php @@ -55,8 +55,11 @@ class XList extends Base ->callback([$this, 'action']); } - public function action(string $siteId, Response $response, Database $dbForProject) - { + public function action( + string $siteId, + Response $response, + Database $dbForProject + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) {