Skip to content

Commit 0981f0b

Browse files
committedJun 20, 2024
Prefix all sprintf() calls
1 parent b23a44f commit 0981f0b

File tree

59 files changed

+114
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+114
-114
lines changed
 

‎AbstractExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getType(string $name): FormTypeInterface
5050
}
5151

5252
if (!isset($this->types[$name])) {
53-
throw new InvalidArgumentException(sprintf('The type "%s" cannot be loaded by this extension.', $name));
53+
throw new InvalidArgumentException(\sprintf('The type "%s" cannot be loaded by this extension.', $name));
5454
}
5555

5656
return $this->types[$name];

‎Command/DebugCommand.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function configure(): void
5353
new InputArgument('class', InputArgument::OPTIONAL, 'The form type class'),
5454
new InputArgument('option', InputArgument::OPTIONAL, 'The form type option'),
5555
new InputOption('show-deprecated', null, InputOption::VALUE_NONE, 'Display deprecated options in form types'),
56-
new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
56+
new InputOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
5757
])
5858
->setHelp(<<<'EOF'
5959
The <info>%command.name%</info> command displays information about form types.
@@ -114,7 +114,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
114114
$object = $resolvedType->getOptionsResolver();
115115

116116
if (!$object->isDefined($option)) {
117-
$message = sprintf('Option "%s" is not defined in "%s".', $option, $resolvedType->getInnerType()::class);
117+
$message = \sprintf('Option "%s" is not defined in "%s".', $option, $resolvedType->getInnerType()::class);
118118

119119
if ($alternatives = $this->findAlternatives($option, $object->getDefinedOptions())) {
120120
if (1 === \count($alternatives)) {
@@ -148,7 +148,7 @@ private function getFqcnTypeClass(InputInterface $input, SymfonyStyle $io, strin
148148
$classes = $this->getFqcnTypeClasses($shortClassName);
149149

150150
if (0 === $count = \count($classes)) {
151-
$message = sprintf("Could not find type \"%s\" into the following namespaces:\n %s", $shortClassName, implode("\n ", $this->namespaces));
151+
$message = \sprintf("Could not find type \"%s\" into the following namespaces:\n %s", $shortClassName, implode("\n ", $this->namespaces));
152152

153153
$allTypes = array_merge($this->getCoreTypes(), $this->types);
154154
if ($alternatives = $this->findAlternatives($shortClassName, $allTypes)) {
@@ -166,10 +166,10 @@ private function getFqcnTypeClass(InputInterface $input, SymfonyStyle $io, strin
166166
return $classes[0];
167167
}
168168
if (!$input->isInteractive()) {
169-
throw new InvalidArgumentException(sprintf("The type \"%s\" is ambiguous.\n\nDid you mean one of these?\n %s.", $shortClassName, implode("\n ", $classes)));
169+
throw new InvalidArgumentException(\sprintf("The type \"%s\" is ambiguous.\n\nDid you mean one of these?\n %s.", $shortClassName, implode("\n ", $classes)));
170170
}
171171

172-
return $io->choice(sprintf("The type \"%s\" is ambiguous.\n\nSelect one of the following form types to display its information:", $shortClassName), $classes, $classes[0]);
172+
return $io->choice(\sprintf("The type \"%s\" is ambiguous.\n\nSelect one of the following form types to display its information:", $shortClassName), $classes, $classes[0]);
173173
}
174174

175175
private function getFqcnTypeClasses(string $shortClassName): array

0 commit comments

Comments
 (0)