Skip to content

Commit 0a8120d

Browse files
authored
Fix CS (#510)
1 parent 58e556c commit 0a8120d

19 files changed

+26
-26
lines changed

Command/CheckMissingCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9393
$io = new SymfonyStyle($input, $output);
9494

9595
if ($newMessages > 0) {
96-
$io->error(sprintf('%d new message(s) have been found, run bin/console translation:extract', $newMessages));
96+
$io->error(\sprintf('%d new message(s) have been found, run bin/console translation:extract', $newMessages));
9797

9898
return 1;
9999
}
@@ -102,7 +102,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
102102

103103
if ($emptyTranslations > 0) {
104104
$io->error(
105-
sprintf('%d messages have empty translations, please provide translations for them', $emptyTranslations)
105+
\sprintf('%d messages have empty translations, please provide translations for them', $emptyTranslations)
106106
);
107107

108108
return 1;

Command/DeleteEmptyCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9999
if ($input->isInteractive()) {
100100
/** @var QuestionHelper $helper */
101101
$helper = $this->getHelper('question');
102-
$question = new ConfirmationQuestion(sprintf('You are about to remove %d translations. Do you wish to continue? (y/N) ', $messageCount), false);
102+
$question = new ConfirmationQuestion(\sprintf('You are about to remove %d translations. Do you wish to continue? (y/N) ', $messageCount), false);
103103
if (!$helper->ask($input, $output, $question)) {
104104
return 0;
105105
}
@@ -112,7 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
112112
foreach ($messages as $message) {
113113
$storage->delete($message->getLocale(), $message->getDomain(), $message->getKey());
114114
if ($output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) {
115-
$output->writeln(sprintf(
115+
$output->writeln(\sprintf(
116116
'Deleted empty message "<info>%s</info>" from domain "<info>%s</info>" and locale "<info>%s</info>"',
117117
$message->getKey(),
118118
$message->getDomain(),

Command/DeleteObsoleteCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
100100
if ($input->isInteractive()) {
101101
/** @var QuestionHelper $helper */
102102
$helper = $this->getHelper('question');
103-
$question = new ConfirmationQuestion(sprintf('You are about to remove %d translations. Do you wish to continue? (y/N) ', $messageCount), false);
103+
$question = new ConfirmationQuestion(\sprintf('You are about to remove %d translations. Do you wish to continue? (y/N) ', $messageCount), false);
104104
if (!$helper->ask($input, $output, $question)) {
105105
return 0;
106106
}
@@ -113,7 +113,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
113113
foreach ($messages as $message) {
114114
$storage->delete($message->getLocale(), $message->getDomain(), $message->getKey());
115115
if ($output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) {
116-
$output->writeln(sprintf(
116+
$output->writeln(\sprintf(
117117
'Deleted obsolete message "<info>%s</info>" from domain "<info>%s</info>" and locale "<info>%s</info>"',
118118
$message->getKey(),
119119
$message->getDomain(),

Command/ExtractCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
130130
/** @var Error $error */
131131
foreach ($errors as $error) {
132132
$io->error(
133-
sprintf("%s\nLine: %s\nMessage: %s", $error->getPath(), $error->getLine(), $error->getMessage())
133+
\sprintf("%s\nLine: %s\nMessage: %s", $error->getPath(), $error->getLine(), $error->getMessage())
134134
);
135135
}
136136
}

Command/StorageTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private function getStorage($configName): StorageService
3131
if (null === $storage = $this->storageManager->getStorage($configName)) {
3232
$availableStorages = $this->storageManager->getNames();
3333

34-
throw new \InvalidArgumentException(sprintf('Unknown storage "%s". Available storages are "%s".', $configName, implode('", "', $availableStorages)));
34+
throw new \InvalidArgumentException(\sprintf('Unknown storage "%s". Available storages are "%s".', $configName, implode('", "', $availableStorages)));
3535
}
3636

3737
return $storage;

Command/SyncCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6060

6161
break;
6262
default:
63-
$output->writeln(sprintf('Direction must be either "up" or "down". Not "%s".', $input->getArgument('direction')));
63+
$output->writeln(\sprintf('Direction must be either "up" or "down". Not "%s".', $input->getArgument('direction')));
6464

6565
return 0;
6666
}

Controller/SymfonyProfilerController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function createAssetsAction(Request $request, string $token): Response
130130
$uploaded[] = $message;
131131
}
132132

133-
return new Response(sprintf('%s new assets created!', \count($uploaded)));
133+
return new Response(\sprintf('%s new assets created!', \count($uploaded)));
134134
}
135135

136136
private function getMessage(Request $request, string $token): SfProfilerMessage
@@ -142,7 +142,7 @@ private function getMessage(Request $request, string $token): SfProfilerMessage
142142
$collectorMessages = $this->getMessages($token);
143143

144144
if (!isset($collectorMessages[$messageId])) {
145-
throw new NotFoundHttpException(sprintf('No message with key "%s" was found.', $messageId));
145+
throw new NotFoundHttpException(\sprintf('No message with key "%s" was found.', $messageId));
146146
}
147147
$message = SfProfilerMessage::create($collectorMessages[$messageId]);
148148

@@ -152,7 +152,7 @@ private function getMessage(Request $request, string $token): SfProfilerMessage
152152

153153
$message
154154
->setLocale($requestCollector->getLocale())
155-
->setTranslation(sprintf('[%s]', $message->getTranslation()))
155+
->setTranslation(\sprintf('[%s]', $message->getTranslation()))
156156
;
157157
}
158158

Controller/WebUIController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function createAction(Request $request, string $configName, string $local
179179
try {
180180
$storage->create($message);
181181
} catch (StorageException $e) {
182-
throw new BadRequestHttpException(sprintf('Key "%s" does already exist for "%s" on domain "%s".', $message->getKey(), $locale, $domain), $e);
182+
throw new BadRequestHttpException(\sprintf('Key "%s" does already exist for "%s" on domain "%s".', $message->getKey(), $locale, $domain), $e);
183183
} catch (\Exception $e) {
184184
return new Response($e->getMessage(), Response::HTTP_BAD_REQUEST);
185185
}

DependencyInjection/CompilerPass/StoragePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function process(ContainerBuilder $container): void
5151

5252
break;
5353
default:
54-
throw new \LogicException(sprintf('The tag "php_translation.storage" must have a "type" of value "local" or "remote". Value "%s" was provided', $tag['type']));
54+
throw new \LogicException(\sprintf('The tag "php_translation.storage" must have a "type" of value "local" or "remote". Value "%s" was provided', $tag['type']));
5555
}
5656
}
5757
}

DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ private function configsNode(ArrayNodeDefinition $root): void
117117

118118
$bundles = $container->getParameter('kernel.bundles');
119119
if (!isset($bundles[$bundleName])) {
120-
throw new \Exception(sprintf('The bundle "%s" does not exist. Available bundles: %s', $bundleName, array_keys($bundles)));
120+
throw new \Exception(\sprintf('The bundle "%s" does not exist. Available bundles: %s', $bundleName, array_keys($bundles)));
121121
}
122122

123123
$ref = new \ReflectionClass($bundles[$bundleName]);
124124
$value = false === $pos ? \dirname($ref->getFileName()) : \dirname($ref->getFileName()).substr($value, $pos);
125125
}
126126

127127
if (!is_dir($value)) {
128-
throw new \Exception(sprintf('The directory "%s" does not exist.', $value));
128+
throw new \Exception(\sprintf('The directory "%s" does not exist.', $value));
129129
}
130130

131131
return $value;

0 commit comments

Comments
 (0)