Skip to content

Commit 5396d2a

Browse files
committed
minor #17085 [2.3] Static Code Analysis for Components (kalessil)
This PR was squashed before being merged into the 2.3 branch (closes #17085). Discussion ---------- [2.3] Static Code Analysis for Components | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Static Code Analysis with Php Inspections (EA Extended): - remaining mkdir race conditions - continue miss-usage in switch Commits ------- 6d303c7 [2.3] Static Code Analysis for Components
2 parents d04bd11 + 643a151 commit 5396d2a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Descriptor/TextDescriptor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function describeInputArgument(InputArgument $argument, array $options
3737

3838
$nameWidth = isset($options['name_width']) ? $options['name_width'] : strlen($argument->getName());
3939
$output = str_replace("\n", "\n".str_repeat(' ', $nameWidth + 2), $argument->getDescription());
40-
$output = sprintf(" <info>%-${nameWidth}s</info> %s%s", $argument->getName(), $output, $default);
40+
$output = sprintf(" <info>%-{$nameWidth}s</info> %s%s", $argument->getName(), $output, $default);
4141

4242
return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output;
4343
}
@@ -56,7 +56,7 @@ protected function describeInputOption(InputOption $option, array $options = arr
5656
$nameWidth = isset($options['name_width']) ? $options['name_width'] : strlen($option->getName());
5757
$nameWithShortcutWidth = $nameWidth - strlen($option->getName()) - 2;
5858

59-
$output = sprintf(" <info>%s</info> %-${nameWithShortcutWidth}s%s%s%s",
59+
$output = sprintf(" <info>%s</info> %-{$nameWithShortcutWidth}s%s%s%s",
6060
'--'.$option->getName(),
6161
$option->getShortcut() ? sprintf('(-%s) ', $option->getShortcut()) : '',
6262
str_replace("\n", "\n".str_repeat(' ', $nameWidth + 2), $option->getDescription()),
@@ -146,7 +146,7 @@ protected function describeApplication(Application $application, array $options
146146
$width = $this->getColumnWidth($description->getCommands());
147147

148148
foreach ($description->getCommands() as $command) {
149-
$messages[] = sprintf("%-${width}s %s", $command->getName(), $command->getDescription());
149+
$messages[] = sprintf("%-{$width}s %s", $command->getName(), $command->getDescription());
150150
}
151151
} else {
152152
$width = $this->getColumnWidth($description->getCommands());
@@ -167,7 +167,7 @@ protected function describeApplication(Application $application, array $options
167167
}
168168

169169
foreach ($namespace['commands'] as $name) {
170-
$messages[] = sprintf(" <info>%-${width}s</info> %s", $name, $description->getCommand($name)->getDescription());
170+
$messages[] = sprintf(" <info>%-{$width}s</info> %s", $name, $description->getCommand($name)->getDescription());
171171
}
172172
}
173173
}

Helper/DialogHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function select(OutputInterface $output, $question, $choices, $default =
4646

4747
$messages = (array) $question;
4848
foreach ($choices as $key => $value) {
49-
$messages[] = sprintf(" [<info>%-${width}s</info>] %s", $key, $value);
49+
$messages[] = sprintf(" [<info>%-{$width}s</info>] %s", $key, $value);
5050
}
5151

5252
$output->writeln($messages);

0 commit comments

Comments
 (0)