mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
fix: 优化 php8 兼容
This commit is contained in:
@@ -299,7 +299,7 @@ class Ask
|
||||
$width = max(array_map('strlen', array_keys($this->question->getChoices())));
|
||||
|
||||
foreach ($this->question->getChoices() as $key => $value) {
|
||||
$this->output->writeln(sprintf(" [<comment>%-${width}s</comment>] %s", $key, $value));
|
||||
$this->output->writeln(sprintf(" [<comment>%-{$width}s</comment>] %s", $key, $value));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ class Descriptor
|
||||
$width = $this->getColumnWidth($description->getCommands());
|
||||
|
||||
foreach ($description->getCommands() as $command) {
|
||||
$this->writeText(sprintf("%-${width}s %s", $command->getName(), $command->getDescription()), $options);
|
||||
$this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options);
|
||||
$this->writeText("\n");
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user