Skip to content

Commit 7a4bc0e

Browse files
CS fixes
1 parent 45ee2b6 commit 7a4bc0e

File tree

75 files changed

+175
-176
lines changed

Some content is hidden

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

75 files changed

+175
-176
lines changed

AbstractExtension.php

Lines changed: 1 addition & 1 deletion
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];

Button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public function handleRequest(mixed $request = null): static
315315
*
316316
* @return $this
317317
*
318-
* @throws Exception\AlreadySubmittedException if the button has already been submitted
318+
* @throws AlreadySubmittedException if the button has already been submitted
319319
*/
320320
public function submit(array|string|null $submittedData, bool $clearMissing = true): static
321321
{

Command/DebugCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function configure()
6565
new InputArgument('class', InputArgument::OPTIONAL, 'The form type class'),
6666
new InputArgument('option', InputArgument::OPTIONAL, 'The form type option'),
6767
new InputOption('show-deprecated', null, InputOption::VALUE_NONE, 'Display deprecated options in form types'),
68-
new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
68+
new InputOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
6969
])
7070
->setHelp(<<<'EOF'
7171
The <info>%command.name%</info> command displays information about form types.
@@ -126,7 +126,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
126126
$object = $resolvedType->getOptionsResolver();
127127

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

131131
if ($alternatives = $this->findAlternatives($option, $object->getDefinedOptions())) {
132132
if (1 === \count($alternatives)) {
@@ -160,7 +160,7 @@ private function getFqcnTypeClass(InputInterface $input, SymfonyStyle $io, strin
160160
$classes = $this->getFqcnTypeClasses($shortClassName);
161161

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

165165
$allTypes = array_merge($this->getCoreTypes(), $this->types);
166166
if ($alternatives = $this->findAlternatives($shortClassName, $allTypes)) {
@@ -178,10 +178,10 @@ private function getFqcnTypeClass(InputInterface $input, SymfonyStyle $io, strin
178178
return $classes[0];
179179
}
180180
if (!$input->isInteractive()) {
181-
throw new InvalidArgumentException(sprintf("The type \"%s\" is ambiguous.\n\nDid you mean one of these?\n %s.", $shortClassName, implode("\n ", $classes)));
181+
throw new InvalidArgumentException(\sprintf("The type \"%s\" is ambiguous.\n\nDid you mean one of these?\n %s.", $shortClassName, implode("\n ", $classes)));
182182
}
183183

184-
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]);
184+
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]);
185185
}
186186

187187
private function getFqcnTypeClasses(string $shortClassName): array

Console/Descriptor/Descriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function describe(OutputInterface $output, ?object $object, array $option
4646
null === $object => $this->describeDefaults($options),
4747
$object instanceof ResolvedFormTypeInterface => $this->describeResolvedFormType($object, $options),
4848
$object instanceof OptionsResolver => $this->describeOption($object, $options),
49-
default => throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))),
49+
default => throw new \InvalidArgumentException(\sprintf('Object of type "%s" is not describable.', get_debug_type($object))),
5050
};
5151
}
5252

Console/Descriptor/TextDescriptor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function describeResolvedFormType(ResolvedFormTypeInterface $resolvedF
8383
'extension' => 'Extension options',
8484
], $formOptions);
8585

86-
$this->output->title(sprintf('%s (Block prefix: "%s")', $resolvedFormType->getInnerType()::class, $resolvedFormType->getInnerType()->getBlockPrefix()));
86+
$this->output->title(\sprintf('%s (Block prefix: "%s")', $resolvedFormType->getInnerType()::class, $resolvedFormType->getInnerType()->getBlockPrefix()));
8787

8888
if ($formOptions) {
8989
$this->output->table($tableHeaders, $this->buildTableRows($tableHeaders, $formOptions));
@@ -134,7 +134,7 @@ protected function describeOption(OptionsResolver $optionsResolver, array $optio
134134
}
135135
array_pop($rows);
136136

137-
$this->output->title(sprintf('%s (%s)', $options['type']::class, $options['option']));
137+
$this->output->title(\sprintf('%s (%s)', $options['type']::class, $options['option']));
138138
$this->output->table([], $rows);
139139
}
140140

@@ -175,7 +175,7 @@ private function normalizeAndSortOptionsColumns(array $options): array
175175
} else {
176176
$options[$group][] = null;
177177
}
178-
$options[$group][] = sprintf('<info>%s</info>', (new \ReflectionClass($class))->getShortName());
178+
$options[$group][] = \sprintf('<info>%s</info>', (new \ReflectionClass($class))->getShortName());
179179
$options[$group][] = new TableSeparator();
180180

181181
sort($opt);
@@ -199,7 +199,7 @@ private function formatClassLink(string $class, ?string $text = null): string
199199
return $text;
200200
}
201201

202-
return sprintf('<href=%s>%s</>', $fileLink, $text);
202+
return \sprintf('<href=%s>%s</>', $fileLink, $text);
203203
}
204204

205205
private function getFileLink(string $class): string

DependencyInjection/FormPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private function processFormTypeExtensions(ContainerBuilder $container): array
9292
}
9393

9494
if (!$extendsTypes) {
95-
throw new InvalidArgumentException(sprintf('The getExtendedTypes() method for service "%s" does not return any extended types.', $serviceId));
95+
throw new InvalidArgumentException(\sprintf('The getExtendedTypes() method for service "%s" does not return any extended types.', $serviceId));
9696
}
9797
}
9898
}

Exception/UnexpectedTypeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class UnexpectedTypeException extends InvalidArgumentException
1515
{
1616
public function __construct(mixed $value, string $expectedType)
1717
{
18-
parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, get_debug_type($value)));
18+
parent::__construct(\sprintf('Expected argument of type "%s", "%s" given', $expectedType, get_debug_type($value)));
1919
}
2020
}

Extension/Core/DataTransformer/ArrayToPartsTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function reverseTransform(mixed $array): mixed
7474
return null;
7575
}
7676

77-
throw new TransformationFailedException(sprintf('The keys "%s" should not be empty.', implode('", "', $emptyKeys)));
77+
throw new TransformationFailedException(\sprintf('The keys "%s" should not be empty.', implode('", "', $emptyKeys)));
7878
}
7979

8080
return $result;

Extension/Core/DataTransformer/BaseDateTimeTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ public function __construct(?string $inputTimezone = null, ?string $outputTimezo
4848
try {
4949
new \DateTimeZone($this->inputTimezone);
5050
} catch (\Exception $e) {
51-
throw new InvalidArgumentException(sprintf('Input timezone is invalid: "%s".', $this->inputTimezone), $e->getCode(), $e);
51+
throw new InvalidArgumentException(\sprintf('Input timezone is invalid: "%s".', $this->inputTimezone), $e->getCode(), $e);
5252
}
5353

5454
try {
5555
new \DateTimeZone($this->outputTimezone);
5656
} catch (\Exception $e) {
57-
throw new InvalidArgumentException(sprintf('Output timezone is invalid: "%s".', $this->outputTimezone), $e->getCode(), $e);
57+
throw new InvalidArgumentException(\sprintf('Output timezone is invalid: "%s".', $this->outputTimezone), $e->getCode(), $e);
5858
}
5959
}
6060
}

Extension/Core/DataTransformer/ChoiceToValueTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function reverseTransform(mixed $value): mixed
4747
return null;
4848
}
4949

50-
throw new TransformationFailedException(sprintf('The choice "%s" does not exist or is not unique.', $value));
50+
throw new TransformationFailedException(\sprintf('The choice "%s" does not exist or is not unique.', $value));
5151
}
5252

5353
return current($choices);

0 commit comments

Comments
 (0)