Skip to content

Commit 234b6c6

Browse files
CS fixes
1 parent 1ac5e7e commit 234b6c6

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

Command/DebugCommand.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8585
$dotenvPath = $this->projectDirectory;
8686

8787
if (is_file($composerFile = $this->projectDirectory.'/composer.json')) {
88-
$runtimeConfig = (json_decode(file_get_contents($composerFile), true))['extra']['runtime'] ?? [];
88+
$runtimeConfig = json_decode(file_get_contents($composerFile), true)['extra']['runtime'] ?? [];
8989

9090
if (isset($runtimeConfig['dotenv_path'])) {
9191
$dotenvPath = $this->projectDirectory.'/'.$runtimeConfig['dotenv_path'];
@@ -98,18 +98,18 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9898
$envFiles = $this->getEnvFiles($filePath);
9999
$availableFiles = array_filter($envFiles, 'is_file');
100100

101-
if (\in_array(sprintf('%s.local.php', $filePath), $availableFiles, true)) {
102-
$io->warning(sprintf('Due to existing dump file (%s.local.php) all other dotenv files are skipped.', $this->getRelativeName($filePath)));
101+
if (\in_array(\sprintf('%s.local.php', $filePath), $availableFiles, true)) {
102+
$io->warning(\sprintf('Due to existing dump file (%s.local.php) all other dotenv files are skipped.', $this->getRelativeName($filePath)));
103103
}
104104

105-
if (is_file($filePath) && is_file(sprintf('%s.dist', $filePath))) {
106-
$io->warning(sprintf('The file %s.dist gets skipped due to the existence of %1$s.', $this->getRelativeName($filePath)));
105+
if (is_file($filePath) && is_file(\sprintf('%s.dist', $filePath))) {
106+
$io->warning(\sprintf('The file %s.dist gets skipped due to the existence of %1$s.', $this->getRelativeName($filePath)));
107107
}
108108

109109
$io->section('Scanned Files (in descending priority)');
110110
$io->listing(array_map(fn (string $envFile) => \in_array($envFile, $availableFiles, true)
111-
? sprintf('<fg=green>✓</> %s', $this->getRelativeName($envFile))
112-
: sprintf('<fg=red>⨯</> %s', $this->getRelativeName($envFile)), $envFiles));
111+
? \sprintf('<fg=green>✓</> %s', $this->getRelativeName($envFile))
112+
: \sprintf('<fg=red>⨯</> %s', $this->getRelativeName($envFile)), $envFiles));
113113

114114
$nameFilter = $input->getArgument('filter');
115115
$variables = $this->getVariables($availableFiles, $nameFilter);
@@ -124,7 +124,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
124124

125125
$io->comment('Note that values might be different between web and CLI.');
126126
} else {
127-
$io->warning(sprintf('No variables match the given filter "%s".', $nameFilter));
127+
$io->warning(\sprintf('No variables match the given filter "%s".', $nameFilter));
128128
}
129129

130130
return 0;
@@ -188,17 +188,17 @@ private function getAvailableVars(): array
188188
private function getEnvFiles(string $filePath): array
189189
{
190190
$files = [
191-
sprintf('%s.local.php', $filePath),
192-
sprintf('%s.%s.local', $filePath, $this->kernelEnvironment),
193-
sprintf('%s.%s', $filePath, $this->kernelEnvironment),
191+
\sprintf('%s.local.php', $filePath),
192+
\sprintf('%s.%s.local', $filePath, $this->kernelEnvironment),
193+
\sprintf('%s.%s', $filePath, $this->kernelEnvironment),
194194
];
195195

196196
if ('test' !== $this->kernelEnvironment) {
197-
$files[] = sprintf('%s.local', $filePath);
197+
$files[] = \sprintf('%s.local', $filePath);
198198
}
199199

200-
if (!is_file($filePath) && is_file(sprintf('%s.dist', $filePath))) {
201-
$files[] = sprintf('%s.dist', $filePath);
200+
if (!is_file($filePath) && is_file(\sprintf('%s.dist', $filePath))) {
201+
$files[] = \sprintf('%s.dist', $filePath);
202202
} else {
203203
$files[] = $filePath;
204204
}

Command/DotenvDumpCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8888
EOF;
8989
file_put_contents($dotenvPath.'.local.php', $vars, \LOCK_EX);
9090

91-
$output->writeln(sprintf('Successfully dumped .env files in <info>.env.local.php</> for the <info>%s</> environment.', $env));
91+
$output->writeln(\sprintf('Successfully dumped .env files in <info>.env.local.php</> for the <info>%s</> environment.', $env));
9292

9393
return 0;
9494
}

Dotenv.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ private function resolveCommands(string $value, array $loadedVars): string
460460
try {
461461
$process->mustRun();
462462
} catch (ProcessException) {
463-
throw $this->createFormatException(sprintf('Issue expanding a command (%s)', $process->getErrorOutput()));
463+
throw $this->createFormatException(\sprintf('Issue expanding a command (%s)', $process->getErrorOutput()));
464464
}
465465

466466
return preg_replace('/[\r\n]+$/', '', $process->getOutput());
@@ -515,7 +515,7 @@ private function resolveVariables(string $value, array $loadedVars): string
515515
if ('' === $value && isset($matches['default_value']) && '' !== $matches['default_value']) {
516516
$unsupportedChars = strpbrk($matches['default_value'], '\'"{$');
517517
if (false !== $unsupportedChars) {
518-
throw $this->createFormatException(sprintf('Unsupported character "%s" found in the default value of variable "$%s".', $unsupportedChars[0], $name));
518+
throw $this->createFormatException(\sprintf('Unsupported character "%s" found in the default value of variable "$%s".', $unsupportedChars[0], $name));
519519
}
520520

521521
$value = substr($matches['default_value'], 2);

Exception/FormatException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(string $message, FormatExceptionContext $context, in
2424
{
2525
$this->context = $context;
2626

27-
parent::__construct(sprintf("%s in \"%s\" at line %d.\n%s", $message, $context->getPath(), $context->getLineno(), $context->getDetails()), $code, $previous);
27+
parent::__construct(\sprintf("%s in \"%s\" at line %d.\n%s", $message, $context->getPath(), $context->getLineno(), $context->getDetails()), $code, $previous);
2828
}
2929

3030
public function getContext(): FormatExceptionContext

Exception/PathException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ final class PathException extends \RuntimeException implements ExceptionInterfac
2020
{
2121
public function __construct(string $path, int $code = 0, ?\Throwable $previous = null)
2222
{
23-
parent::__construct(sprintf('Unable to read the "%s" environment file.', $path), $code, $previous);
23+
parent::__construct(\sprintf('Unable to read the "%s" environment file.', $path), $code, $previous);
2424
}
2525
}

0 commit comments

Comments
 (0)