5 * Contains Drupal\Console\Core\Command\ShowFileHelper.
8 namespace Drupal\Console\Core\Utils;
10 use Drupal\Console\Core\Style\DrupalStyle;
13 * Class ShowFileHelper
15 * @package Drupal\Console\Core\Utils
25 * @var TranslatorManagerInterface
27 protected $translator;
30 * ShowFile constructor.
33 * @param TranslatorManagerInterface $translator
35 public function __construct(
37 TranslatorManagerInterface $translator
40 $this->translator = $translator;
44 * @param DrupalStyle $io
45 * @param string $files
46 * @param boolean $showPath
48 public function generatedFiles($io, $files, $showPath = true)
53 $pathKey = 'application.user.messages.path';
59 'application.messages.files.generated',
66 * @param DrupalStyle $io
67 * @param string $files
68 * @param boolean $showPath
70 public function copiedFiles($io, $files, $showPath = true)
75 $pathKey = 'application.user.messages.path';
76 $path = rtrim(getenv('HOME') ?: getenv('USERPROFILE'), '/\\').'/.console/';
81 'application.messages.files.copied',
88 * @param DrupalStyle $io
90 * @param string $headerKey
91 * @param string $pathKey
94 private function showMMultiple($io, $files, $headerKey, $pathKey, $path)
100 $io->writeln($this->translator->trans($headerKey));
104 sprintf('%s:', $this->translator->trans($pathKey)),
109 $io->comment($path, false);
114 foreach ($files as $file) {
115 $this->showSingle($io, $file, $index);
121 * @param DrupalStyle $io
122 * @param string $file
125 private function showSingle(DrupalStyle $io, $file, $index)
128 sprintf('%s -', $index),
131 $io->comment($file, false);