From 0f85f59ae3a2ec22812fbb6f61452c3e4b791ad7 Mon Sep 17 00:00:00 2001 From: Baptiste Fotia Date: Wed, 15 Nov 2023 10:43:36 +0100 Subject: [PATCH] chore(php): Change the wording I changed the wording for warning and error messages. Signed-off-by: Baptiste Fotia --- lib/Commands/Create.php | 10 +++++----- lib/Commands/Import.php | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/Commands/Create.php b/lib/Commands/Create.php index cfb799b7b..d2addb227 100644 --- a/lib/Commands/Create.php +++ b/lib/Commands/Create.php @@ -75,7 +75,7 @@ protected function configure(): void { 'user-workspace-manager', 'uwm', InputOption::VALUE_REQUIRED, - 'The user will be workspace manager of your workspace. Please, use its uid or email address' + 'The user will be workspace manager of your workspace. Please, use its user-id or email address' ); parent::configure(); @@ -89,21 +89,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->hasParameterOption('--user-workspace-manager')) { $pattern = $input->getOption('user-workspace-manager'); if (!$this->userChecker->checkUserExist($pattern)) { - $this->logger->error("The $pattern user or email is not exist."); - throw new \Exception("The $pattern user or email is not exist."); + $this->logger->error("$pattern could not be found. Please, make sure user-id or email exists in the Nextcloud instance."); + throw new \Exception("$pattern could not be found. Please, make sure user-id or email exists in the Nextcloud instance."); } } if ($this->checkValueFormatOptionIsValid($input)) { $this->logger->error( sprintf( - "The value is not valid.\nPlease, define an option valid : %s", + "The format value is not valid.\nPlease, add a valid option : %s", implode(', ', self::OPTION_FORMAT_AVAILABLE) ) ); throw new \Exception( sprintf( - "The value is not valid.\nPlease, define an option valid : %s", + "The format value is not valid.\nPlease, add a valid option : %s", implode(', ', self::OPTION_FORMAT_AVAILABLE) ) ); diff --git a/lib/Commands/Import.php b/lib/Commands/Import.php index 267198e69..e83550d61 100644 --- a/lib/Commands/Import.php +++ b/lib/Commands/Import.php @@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int "No respect the glossary headers. " . "Please, you must define these 2 headers : " . "%s : To specify the workspace name; " - . "%s : To specify the user's uid or email address.", + . "%s : To specify the user's user-id or email address.", implode(", ", Csv::WORKSPACE_FIELD), implode(", ", Csv::USER_FIELD) )); @@ -78,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int "No respect the glossary headers.\n\n" . "Please, you must define these 2 headers :\n" . " - %s : To specify the workspace name.\n" - . " - %s : To specify the user's uid or email address.", + . " - %s : To specify the user's user-id or email address.", implode(", ", Csv::WORKSPACE_FIELD), implode(", ", Csv::USER_FIELD) ) @@ -111,8 +111,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->adminGroup->addUser($user, $groupname); } - $this->logger->info("The import is done."); - $output->writeln("The import is done."); + $this->logger->info("Workspaces import done."); + $output->writeln("Workspaces import done."); return 0; } @@ -120,7 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int protected function configure(): void { $this ->setName('workspace:import') - ->setDescription('This command allows you to import a csv file to create workspaces and define the workspace manager users.') + ->setDescription('This command allows you to import a csv file to create workspaces and define their managers.') ->addArgument('path', InputArgument::REQUIRED, 'The path of the csv file.'); parent::configure(); } @@ -137,7 +137,7 @@ private function getSpacenamesDuplicated(array $dataResponse): ?string { if (!empty($workspacesAreNotExist)) { $workspacesAreNotExist = array_map(fn ($spacename) => " - $spacename\n", $workspacesAreNotExist); - $message .= "Workspace names below already exist :\n" . implode('', $workspacesAreNotExist); + $message .= "The Workspace names below already exist:\n" . implode('', $workspacesAreNotExist); $message .= "\n"; return $message; @@ -158,7 +158,7 @@ private function getUsersArentExist(array $dataResponse): ?string { if (!empty($usersAreNotExist)) { $usersAreNotExist = array_map(fn ($username) => " - $username\n", $usersAreNotExist); - $message .= "Users below aren't known :\n" . implode('', $usersAreNotExist); + $message .= "The below users do not exist:\n" . implode('', $usersAreNotExist); return $message; } @@ -178,8 +178,8 @@ private function getWorkspacesWithCharacterSpecials(array $dataResponse): ?strin if (!empty($spacenamesWithCharacterSpecials)) { $spacenamesStringify = array_map(fn ($spacename) => " - $spacename\n", $spacenamesWithCharacterSpecials); - $message .= "The workspace names below contain special characters :\n" . implode('', $spacenamesStringify); - $message .= "\nPlease, your Workspace names must not contain the following characters: " . implode(" ", str_split(WorkspaceCheckService::CHARACTERS_SPECIAL)); + $message .= "The below workspace names contain special characters :\n" . implode('', $spacenamesStringify); + $message .= "\nPlease, make sure the Workspace names do not contain one of the following characters: " . implode(" ", str_split(WorkspaceCheckService::CHARACTERS_SPECIAL)); return $message; }