From bdfb930097607db195e3b7e732297824c8153215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 9 Jan 2024 16:22:10 +0000 Subject: [PATCH] Linter fix --- .../Platform/Tasks/DevGenerateTranslations.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/DevGenerateTranslations.php b/src/Appwrite/Platform/Tasks/DevGenerateTranslations.php index 1bc7e27442..336a378c70 100644 --- a/src/Appwrite/Platform/Tasks/DevGenerateTranslations.php +++ b/src/Appwrite/Platform/Tasks/DevGenerateTranslations.php @@ -33,7 +33,7 @@ class DevGenerateTranslations extends Action Console::info("Started"); - if(!$dryRun && empty($apiKey)) { + if (!$dryRun && empty($apiKey)) { Console::error("Please specify --api-key='OPEN_AI_API_KEY' or run with --dry-run"); return; } @@ -53,8 +53,8 @@ class DevGenerateTranslations extends Action $fileKeys = \array_keys($fileJson); foreach ($mainKeys as $key) { - if(!(\in_array($key, $fileKeys))) { - if($dryRun) { + if (!(\in_array($key, $fileKeys))) { + if ($dryRun) { Console::warning("{$file} missing translation for {$key}"); } else { $language = \explode('.', $file)[0]; @@ -62,7 +62,7 @@ class DevGenerateTranslations extends Action $json = \json_decode(\file_get_contents($dir . '/' . $file), true); $json[$key] = $translation; - \file_put_contents($dir . '/' . $file, \json_encode($json, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|0)); + \file_put_contents($dir . '/' . $file, \json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | 0)); Console::success("Generated {$key} for {$language}"); } @@ -94,7 +94,7 @@ class DevGenerateTranslations extends Action $body = \json_decode($response->getBody(), true); - if($response->getStatusCode() >= 400) { + if ($response->getStatusCode() >= 400) { throw new Exception($response->getBody() . ' with status code ' . $response->getStatusCode() . ' for language ' . $targetLanguage . ' and message ' . $enTranslation); }