X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FDebug%2FImageStylesCommand.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FDebug%2FImageStylesCommand.php;h=4801c344e4f53e1b8759bfc4cfe4d3c0e69ed807;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/drupal/console/src/Command/Debug/ImageStylesCommand.php b/vendor/drupal/console/src/Command/Debug/ImageStylesCommand.php new file mode 100644 index 000000000..4801c344e --- /dev/null +++ b/vendor/drupal/console/src/Command/Debug/ImageStylesCommand.php @@ -0,0 +1,92 @@ +entityTypeManager = $entityTypeManager; + parent::__construct(); + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('debug:image:styles') + ->setDescription($this->trans('commands.debug.image.styles.description')) + ->setAliases(['dis']); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $imageStyle = $this->entityTypeManager->getStorage('image_style'); + + $this->getIo()->newLine(); + $this->getIo()->comment( + $this->trans('commands.debug.image.styles.messages.styles-list') + ); + + if ($imageStyle) { + $this->imageStyleList($imageStyle); + } + + return 0; + } + + /** + * @param $imageStyle + */ + protected function imageStyleList($imageStyle) + { + $tableHeader = [ + $this->trans('commands.debug.image.styles.messages.styles-name'), + $this->trans('commands.debug.image.styles.messages.styles-label') + ]; + + $tableRows = []; + + foreach ($imageStyle->loadMultiple() as $styles) { + $tableRows[] = [ + $styles->get('name'), + $styles->get('label') + ]; + } + + $this->getIo()->table( + $tableHeader, + $tableRows + ); + } +}