X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FImage%2FStylesFlushCommand.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FImage%2FStylesFlushCommand.php;h=b94e69d536c9764ce3ff4b802c953948af030853;hp=afc963ef3fec7357ab35941082d88f23bf0302f9;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/drupal/console/src/Command/Image/StylesFlushCommand.php b/vendor/drupal/console/src/Command/Image/StylesFlushCommand.php index afc963ef3..b94e69d53 100644 --- a/vendor/drupal/console/src/Command/Image/StylesFlushCommand.php +++ b/vendor/drupal/console/src/Command/Image/StylesFlushCommand.php @@ -9,15 +9,11 @@ namespace Drupal\Console\Command\Image; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Command\Command; +use Drupal\Console\Core\Command\Command; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Console\Core\Command\Shared\CommandTrait; -use Drupal\Console\Core\Style\DrupalStyle; class StylesFlushCommand extends Command { - use CommandTrait; - /** * @var EntityTypeManagerInterface */ @@ -43,7 +39,7 @@ class StylesFlushCommand extends Command 'styles', InputArgument::IS_ARRAY | InputArgument::REQUIRED, $this->trans('commands.image.styles.flush.options.image-style') - ); + )->setAliases(['isf']); } /** @@ -51,7 +47,6 @@ class StylesFlushCommand extends Command */ protected function interact(InputInterface $input, OutputInterface $output) { - $io = new DrupalStyle($input, $output); $styles = $input->getArgument('styles'); if (!$styles) { $imageStyle = $this->entityTypeManager->getStorage('image_style'); @@ -61,7 +56,7 @@ class StylesFlushCommand extends Command $styleNames[] = $style->get('name'); } - $styles = $io->choice( + $styles = $this->getIo()->choice( $this->trans('commands.image.styles.flush.questions.image-style'), $styleNames, null, @@ -77,7 +72,6 @@ class StylesFlushCommand extends Command */ protected function execute(InputInterface $input, OutputInterface $output) { - $io = new DrupalStyle($input, $output); $styles = $input->getArgument('styles'); $result = 0; @@ -94,7 +88,7 @@ class StylesFlushCommand extends Command foreach ($styles as $style) { try { - $io->info( + $this->getIo()->info( sprintf( $this->trans('commands.image.styles.flush.messages.executing-flush'), $style @@ -103,12 +97,12 @@ class StylesFlushCommand extends Command $imageStyle->load($style)->flush(); } catch (\Exception $e) { watchdog_exception('image', $e); - $io->error($e->getMessage()); + $this->getIo()->error($e->getMessage()); $result = 1; } } - $io->success($this->trans('commands.image.styles.flush.messages.success')); + $this->getIo()->success($this->trans('commands.image.styles.flush.messages.success')); return $result; }