mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Improved GenerateCharsetCommand by using SymfonyStyle
This commit is contained in:
parent
1993d01110
commit
1b94083188
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,7 @@ use Shlinkio\Shlink\Core\Service\UrlShortener;
|
|||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Zend\I18n\Translator\TranslatorInterface;
|
||||
|
||||
class GenerateCharsetCommand extends Command
|
||||
|
@ -36,6 +37,8 @@ class GenerateCharsetCommand extends Command
|
|||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$charSet = str_shuffle(UrlShortener::DEFAULT_CHARS);
|
||||
$output->writeln($this->translator->translate('Character set:') . sprintf(' <info>%s</info>', $charSet));
|
||||
(new SymfonyStyle($input, $output))->success(
|
||||
\sprintf($this->translator->translate('Character set: "%s"'), $charSet)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue