diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index e57936be73..d25332126c 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -314,7 +314,7 @@ class Exception extends \Exception $this->code = $code ?? $this->errors[$type]['code']; // Mark string errors like HY001 from PDO as 500 errors - if(\is_string($this->code)) { + if (\is_string($this->code)) { if (\is_numeric($this->code)) { $this->code = (int) $this->code; } else { diff --git a/src/Appwrite/Functions/Validator/Headers.php b/src/Appwrite/Functions/Validator/Headers.php index 6d5b2da5df..04003d535b 100644 --- a/src/Appwrite/Functions/Validator/Headers.php +++ b/src/Appwrite/Functions/Validator/Headers.php @@ -44,7 +44,7 @@ class Headers extends Validator return false; } - if(\count($value) > $this->maxKeys) { + if (\count($value) > $this->maxKeys) { return false; } @@ -57,7 +57,7 @@ class Headers extends Validator } $size += $length + \strlen($val); - if($size >= $this->maxSize) { + if ($size >= $this->maxSize) { return false; } diff --git a/src/Appwrite/Platform/Workers/Builds.php b/src/Appwrite/Platform/Workers/Builds.php index d8359f5f65..2b8acf8177 100644 --- a/src/Appwrite/Platform/Workers/Builds.php +++ b/src/Appwrite/Platform/Workers/Builds.php @@ -208,7 +208,7 @@ class Builds extends Action } try { - if($isNewBuild && !$isVcsEnabled) { + if ($isNewBuild && !$isVcsEnabled) { // Non-vcs+Template $templateRepositoryName = $template->getAttribute('repositoryName', ''); @@ -279,7 +279,7 @@ class Builds extends Action $cloneVersion = $branchName; $cloneType = GitHub::CLONE_TYPE_BRANCH; - if(!empty($commitHash)) { + if (!empty($commitHash)) { $cloneVersion = $commitHash; $cloneType = GitHub::CLONE_TYPE_COMMIT; } @@ -543,7 +543,7 @@ class Builds extends Action deploymentId: $deployment->getId(), projectId: $project->getId(), callback: function ($logs) use (&$response, &$err, &$build, $dbForProject, $allEvents, $project, &$isCanceled) { - if($isCanceled) { + if ($isCanceled) { return; } diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 6f642fabb7..0f0d298e3b 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -669,7 +669,7 @@ class Messaging extends Action private function getLocalDevice($project): Local { - if($this->localDevice === null) { + if ($this->localDevice === null) { $this->localDevice = new Local(APP_STORAGE_UPLOADS . '/app-' . $project->getId()); } diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 4595a4cb6c..2eab7807b3 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -287,7 +287,7 @@ class Swagger2 extends Format } $validatorClass = (!empty($validator)) ? \get_class($validator) : ''; - if($validatorClass === 'Utopia\Validator\AnyOf') { + if ($validatorClass === 'Utopia\Validator\AnyOf') { $validator = $param['validator']->getValidators()[0]; $validatorClass = \get_class($validator); } diff --git a/src/Appwrite/Utopia/Response/Filters/V16.php b/src/Appwrite/Utopia/Response/Filters/V16.php index 2a27715d5e..7eb3ec6eb3 100644 --- a/src/Appwrite/Utopia/Response/Filters/V16.php +++ b/src/Appwrite/Utopia/Response/Filters/V16.php @@ -33,13 +33,13 @@ class V16 extends Filter protected function parseDeployment(array $content) { - if(isset($content['buildLogs'])) { + if (isset($content['buildLogs'])) { $content['buildStderr'] = ''; $content['buildStdout'] = $content['buildLogs']; unset($content['buildLogs']); } - if(isset($content['buildSize'])) { + if (isset($content['buildSize'])) { $content['size'] += + $content['buildSize'] ?? 0; unset($content['buildSize']); } diff --git a/src/Appwrite/Utopia/Response/Filters/V18.php b/src/Appwrite/Utopia/Response/Filters/V18.php index 0a74a2afed..fc1624a289 100644 --- a/src/Appwrite/Utopia/Response/Filters/V18.php +++ b/src/Appwrite/Utopia/Response/Filters/V18.php @@ -25,8 +25,8 @@ class V18 extends Filter protected function parseExecution(array $content) { - if(!empty($content['status']) && !empty($content['statusCode'])) { - if($content['status'] === 'completed' && $content['statusCode'] >= 400 && $content['statusCode'] < 500) { + if (!empty($content['status']) && !empty($content['statusCode'])) { + if ($content['status'] === 'completed' && $content['statusCode'] >= 400 && $content['statusCode'] < 500) { $content['status'] = 'failed'; } } diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 7cd239623c..c230cfb664 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -217,7 +217,7 @@ class Executor 'restartPolicy' => 'always' // Once utopia/orchestration has it, use DockerAPI::ALWAYS (0.13+) ]; - if(!empty($body)) { + if (!empty($body)) { $params['body'] = $body; } diff --git a/tests/e2e/Services/Functions/FunctionsBase.php b/tests/e2e/Services/Functions/FunctionsBase.php index abefb5c9a3..2d94b9f0e3 100644 --- a/tests/e2e/Services/Functions/FunctionsBase.php +++ b/tests/e2e/Services/Functions/FunctionsBase.php @@ -34,7 +34,7 @@ trait FunctionsBase \sleep(1); } - if($checkForSuccess) { + if ($checkForSuccess) { $this->assertEquals(200, $deployment['headers']['status-code']); $this->assertEquals('ready', $deployment['body']['status'], \json_encode($deployment['body'])); } diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 0607f40924..912a7a3f2c 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -1072,7 +1072,7 @@ class FunctionsCustomServerTest extends Scope $found = false; foreach ($response['body']['deployments'] as $deployment) { - if($deployment['$id'] === $deploymentId) { + if ($deployment['$id'] === $deploymentId) { $found = true; $this->assertEquals($deploymentSize, $deployment['size']); break; diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index 6f6b36c520..6be3e16c1f 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -31,7 +31,7 @@ trait WebhooksBase \sleep(1); } - if($checkForSuccess) { + if ($checkForSuccess) { $this->assertEquals(200, $deployment['headers']['status-code']); $this->assertEquals('ready', $deployment['body']['status'], \json_encode($deployment['body'])); }