Skip to content

Commit 291b51e

Browse files
CS fixes
1 parent 4ec0de9 commit 291b51e

File tree

72 files changed

+350
-350
lines changed

Some content is hidden

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

72 files changed

+350
-350
lines changed

CacheWarmer/RouterCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function warmUp(string $cacheDir, ?string $buildDir = null): array
4242
return (array) $router->warmUp($cacheDir, $buildDir);
4343
}
4444

45-
throw new \LogicException(sprintf('The router "%s" cannot be warmed up because it does not implement "%s".', get_debug_type($router), WarmableInterface::class));
45+
throw new \LogicException(\sprintf('The router "%s" cannot be warmed up because it does not implement "%s".', get_debug_type($router), WarmableInterface::class));
4646
}
4747

4848
public function isOptional(): bool

Command/AbstractConfigCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected function findExtension(string $name): ExtensionInterface
117117
foreach ($bundles as $bundle) {
118118
if ($name === $bundle->getName()) {
119119
if (!$bundle->getContainerExtension()) {
120-
throw new \LogicException(sprintf('Bundle "%s" does not have a container extension.', $name));
120+
throw new \LogicException(\sprintf('Bundle "%s" does not have a container extension.', $name));
121121
}
122122

123123
return $bundle->getContainerExtension();
@@ -147,13 +147,13 @@ protected function findExtension(string $name): ExtensionInterface
147147
}
148148

149149
if (!str_ends_with($name, 'Bundle')) {
150-
$message = sprintf('No extensions with configuration available for "%s".', $name);
150+
$message = \sprintf('No extensions with configuration available for "%s".', $name);
151151
} else {
152-
$message = sprintf('No extension with alias "%s" is enabled.', $name);
152+
$message = \sprintf('No extension with alias "%s" is enabled.', $name);
153153
}
154154

155155
if (isset($guess) && $minScore < 3) {
156-
$message .= sprintf("\n\nDid you mean \"%s\"?", $guess);
156+
$message .= \sprintf("\n\nDid you mean \"%s\"?", $guess);
157157
}
158158

159159
throw new LogicException($message);
@@ -165,11 +165,11 @@ protected function findExtension(string $name): ExtensionInterface
165165
public function validateConfiguration(ExtensionInterface $extension, mixed $configuration)
166166
{
167167
if (!$configuration) {
168-
throw new \LogicException(sprintf('The extension with alias "%s" does not have its getConfiguration() method setup.', $extension->getAlias()));
168+
throw new \LogicException(\sprintf('The extension with alias "%s" does not have its getConfiguration() method setup.', $extension->getAlias()));
169169
}
170170

171171
if (!$configuration instanceof ConfigurationInterface) {
172-
throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable.', get_debug_type($configuration)));
172+
throw new \LogicException(\sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable.', get_debug_type($configuration)));
173173
}
174174
}
175175

Command/AssetsInstallCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9797
$targetArg = $kernel->getProjectDir().'/'.$targetArg;
9898

9999
if (!is_dir($targetArg)) {
100-
throw new InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $targetArg));
100+
throw new InvalidArgumentException(\sprintf('The target directory "%s" does not exist.', $targetArg));
101101
}
102102
}
103103

@@ -134,7 +134,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
134134
$validAssetDirs[] = $assetDir;
135135

136136
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
137-
$message = sprintf("%s\n-> %s", $bundle->getName(), $targetDir);
137+
$message = \sprintf("%s\n-> %s", $bundle->getName(), $targetDir);
138138
} else {
139139
$message = $bundle->getName();
140140
}
@@ -155,13 +155,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
155155
}
156156

157157
if ($method === $expectedMethod) {
158-
$rows[] = [sprintf('<fg=green;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method];
158+
$rows[] = [\sprintf('<fg=green;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method];
159159
} else {
160-
$rows[] = [sprintf('<fg=yellow;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method];
160+
$rows[] = [\sprintf('<fg=yellow;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method];
161161
}
162162
} catch (\Exception $e) {
163163
$exitCode = 1;
164-
$rows[] = [sprintf('<fg=red;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage()];
164+
$rows[] = [\sprintf('<fg=red;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage()];
165165
}
166166
}
167167
// remove the assets of the bundles that no longer exist
@@ -234,7 +234,7 @@ private function symlink(string $originDir, string $targetDir, bool $relative =
234234
}
235235
$this->filesystem->symlink($originDir, $targetDir);
236236
if (!file_exists($targetDir)) {
237-
throw new IOException(sprintf('Symbolic link "%s" was created but appears to be broken.', $targetDir), 0, null, $targetDir);
237+
throw new IOException(\sprintf('Symbolic link "%s" was created but appears to be broken.', $targetDir), 0, null, $targetDir);
238238
}
239239
}
240240

Command/CacheClearCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8080
$fs->remove($oldCacheDir);
8181

8282
if (!is_writable($realCacheDir)) {
83-
throw new RuntimeException(sprintf('Unable to write in the "%s" directory.', $realCacheDir));
83+
throw new RuntimeException(\sprintf('Unable to write in the "%s" directory.', $realCacheDir));
8484
}
8585

8686
$useBuildDir = $realBuildDir !== $realCacheDir;
@@ -89,7 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8989
$fs->remove($oldBuildDir);
9090

9191
if (!is_writable($realBuildDir)) {
92-
throw new RuntimeException(sprintf('Unable to write in the "%s" directory.', $realBuildDir));
92+
throw new RuntimeException(\sprintf('Unable to write in the "%s" directory.', $realBuildDir));
9393
}
9494

9595
if ($this->isNfs($realCacheDir)) {
@@ -100,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
100100
$fs->mkdir($realCacheDir);
101101
}
102102

103-
$io->comment(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
103+
$io->comment(\sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
104104
if ($useBuildDir) {
105105
$this->cacheClearer->clear($realBuildDir);
106106
}
@@ -199,7 +199,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
199199
$io->comment('Finished');
200200
}
201201

202-
$io->success(sprintf('Cache for the "%s" environment (debug=%s) was successfully cleared.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
202+
$io->success(\sprintf('Cache for the "%s" environment (debug=%s) was successfully cleared.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
203203

204204
return 0;
205205
}

Command/CachePoolClearCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,28 +99,28 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9999
} elseif ($pool instanceof Psr6CacheClearer) {
100100
$clearers[$id] = $pool;
101101
} else {
102-
throw new InvalidArgumentException(sprintf('"%s" is not a cache pool nor a cache clearer.', $id));
102+
throw new InvalidArgumentException(\sprintf('"%s" is not a cache pool nor a cache clearer.', $id));
103103
}
104104
}
105105
}
106106

107107
foreach ($clearers as $id => $clearer) {
108-
$io->comment(sprintf('Calling cache clearer: <info>%s</info>', $id));
108+
$io->comment(\sprintf('Calling cache clearer: <info>%s</info>', $id));
109109
$clearer->clear($kernel->getContainer()->getParameter('kernel.cache_dir'));
110110
}
111111

112112
$failure = false;
113113
foreach ($pools as $id => $pool) {
114-
$io->comment(sprintf('Clearing cache pool: <info>%s</info>', $id));
114+
$io->comment(\sprintf('Clearing cache pool: <info>%s</info>', $id));
115115

116116
if ($pool instanceof CacheItemPoolInterface) {
117117
if (!$pool->clear()) {
118-
$io->warning(sprintf('Cache pool "%s" could not be cleared.', $pool));
118+
$io->warning(\sprintf('Cache pool "%s" could not be cleared.', $pool));
119119
$failure = true;
120120
}
121121
} else {
122122
if (false === $this->poolClearer->clearPool($id)) {
123-
$io->warning(sprintf('Cache pool "%s" could not be cleared.', $pool));
123+
$io->warning(\sprintf('Cache pool "%s" could not be cleared.', $pool));
124124
$failure = true;
125125
}
126126
}

Command/CachePoolDeleteCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6767
$cachePool = $this->poolClearer->getPool($pool);
6868

6969
if (!$cachePool->hasItem($key)) {
70-
$io->note(sprintf('Cache item "%s" does not exist in cache pool "%s".', $key, $pool));
70+
$io->note(\sprintf('Cache item "%s" does not exist in cache pool "%s".', $key, $pool));
7171

7272
return 0;
7373
}
7474

7575
if (!$cachePool->deleteItem($key)) {
76-
throw new \Exception(sprintf('Cache item "%s" could not be deleted.', $key));
76+
throw new \Exception(\sprintf('Cache item "%s" could not be deleted.', $key));
7777
}
7878

79-
$io->success(sprintf('Cache item "%s" was successfully deleted.', $key));
79+
$io->success(\sprintf('Cache item "%s" was successfully deleted.', $key));
8080

8181
return 0;
8282
}

Command/CachePoolInvalidateTagsCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,26 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6565
$errors = false;
6666

6767
foreach ($pools as $name) {
68-
$io->comment(sprintf('Invalidating tag(s): <info>%s</info> from pool <comment>%s</comment>.', $tagList, $name));
68+
$io->comment(\sprintf('Invalidating tag(s): <info>%s</info> from pool <comment>%s</comment>.', $tagList, $name));
6969

7070
try {
7171
$pool = $this->pools->get($name);
7272
} catch (ServiceNotFoundException) {
73-
$io->error(sprintf('Pool "%s" not found.', $name));
73+
$io->error(\sprintf('Pool "%s" not found.', $name));
7474
$errors = true;
7575

7676
continue;
7777
}
7878

7979
if (!$pool instanceof TagAwareCacheInterface) {
80-
$io->error(sprintf('Pool "%s" is not taggable.', $name));
80+
$io->error(\sprintf('Pool "%s" is not taggable.', $name));
8181
$errors = true;
8282

8383
continue;
8484
}
8585

8686
if (!$pool->invalidateTags($tags)) {
87-
$io->error(sprintf('Cache tag(s) "%s" could not be invalidated for pool "%s".', $tagList, $name));
87+
$io->error(\sprintf('Cache tag(s) "%s" could not be invalidated for pool "%s".', $tagList, $name));
8888
$errors = true;
8989
}
9090
}

Command/CachePoolPruneCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5555
$io = new SymfonyStyle($input, $output);
5656

5757
foreach ($this->pools as $name => $pool) {
58-
$io->comment(sprintf('Pruning cache pool: <info>%s</info>', $name));
58+
$io->comment(\sprintf('Pruning cache pool: <info>%s</info>', $name));
5959
$pool->prune();
6060
}
6161

Command/CacheWarmupCommand.php

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

6363
$kernel = $this->getApplication()->getKernel();
64-
$io->comment(sprintf('Warming up the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
64+
$io->comment(\sprintf('Warming up the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
6565

6666
if (!$input->getOption('no-optional-warmers')) {
6767
$this->cacheWarmer->enableOptionalWarmers();
@@ -79,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7979
Preloader::append($preloadFile, $preload);
8080
}
8181

82-
$io->success(sprintf('Cache for the "%s" environment (debug=%s) was successfully warmed.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
82+
$io->success(\sprintf('Cache for the "%s" environment (debug=%s) was successfully warmed.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
8383

8484
return 0;
8585
}

Command/ConfigDebugCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ class ConfigDebugCommand extends AbstractConfigCommand
4141
{
4242
protected function configure(): void
4343
{
44-
$commentedHelpFormats = array_map(fn ($format) => sprintf('<comment>%s</comment>', $format), $this->getAvailableFormatOptions());
44+
$commentedHelpFormats = array_map(fn ($format) => \sprintf('<comment>%s</comment>', $format), $this->getAvailableFormatOptions());
4545
$helpFormats = implode('", "', $commentedHelpFormats);
4646

4747
$this
4848
->setDefinition([
4949
new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'),
5050
new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),
5151
new InputOption('resolve-env', null, InputOption::VALUE_NONE, 'Display resolved environment variable values instead of placeholders'),
52-
new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), class_exists(Yaml::class) ? 'txt' : 'json'),
52+
new InputOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), class_exists(Yaml::class) ? 'txt' : 'json'),
5353
])
5454
->setHelp(<<<EOF
5555
The <info>%command.name%</info> command dumps the current configuration for an
@@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
106106
if (null === $path = $input->getArgument('path')) {
107107
if ('txt' === $input->getOption('format')) {
108108
$io->title(
109-
sprintf('Current configuration for %s', $name === $extensionAlias ? sprintf('extension with alias "%s"', $extensionAlias) : sprintf('"%s"', $name))
109+
\sprintf('Current configuration for %s', $name === $extensionAlias ? \sprintf('extension with alias "%s"', $extensionAlias) : \sprintf('"%s"', $name))
110110
);
111111
}
112112

@@ -123,7 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
123123
return 1;
124124
}
125125

126-
$io->title(sprintf('Current configuration for "%s.%s"', $extensionAlias, $path));
126+
$io->title(\sprintf('Current configuration for "%s.%s"', $extensionAlias, $path));
127127

128128
$io->writeln($this->convertToFormat($config, $format));
129129

@@ -135,7 +135,7 @@ private function convertToFormat(mixed $config, string $format): string
135135
return match ($format) {
136136
'txt', 'yaml' => Yaml::dump($config, 10),
137137
'json' => json_encode($config, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE),
138-
default => throw new InvalidArgumentException(sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))),
138+
default => throw new InvalidArgumentException(\sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))),
139139
};
140140
}
141141

@@ -162,7 +162,7 @@ private function getConfigForPath(array $config, string $path, string $alias): m
162162

163163
foreach ($steps as $step) {
164164
if (!\array_key_exists($step, $config)) {
165-
throw new LogicException(sprintf('Unable to find configuration for "%s.%s".', $alias, $path));
165+
throw new LogicException(\sprintf('Unable to find configuration for "%s.%s".', $alias, $path));
166166
}
167167

168168
$config = $config[$step];
@@ -190,7 +190,7 @@ private function getConfigForExtension(ExtensionInterface $extension, ContainerB
190190
// Fall back to default config if the extension has one
191191

192192
if (!$extension instanceof ConfigurationExtensionInterface && !$extension instanceof ConfigurationInterface) {
193-
throw new \LogicException(sprintf('The extension with alias "%s" does not have configuration.', $extensionAlias));
193+
throw new \LogicException(\sprintf('The extension with alias "%s" does not have configuration.', $extensionAlias));
194194
}
195195

196196
$configs = $container->getExtensionConfig($extensionAlias);

0 commit comments

Comments
 (0)