annotate vendor/chi-teck/drupal-code-generator/templates/other/drupal-console-command.twig @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\{{ machine_name }}\Command;
Chris@0 4
Chris@0 5 use Drupal\Console\Command\Shared\{{ command_trait }};
Chris@0 6 use Drupal\Console\Style\DrupalStyle;
Chris@0 7 use Symfony\Component\Console\Command\Command;
Chris@0 8 use Symfony\Component\Console\Input\InputInterface;
Chris@0 9 use Symfony\Component\Console\Output\OutputInterface;
Chris@0 10
Chris@0 11 /**
Chris@0 12 * Implements {{ command_name }} command.
Chris@0 13 */
Chris@0 14 class {{ class }} extends Command {
Chris@0 15
Chris@0 16 use {{ command_trait }};
Chris@0 17
Chris@0 18 /**
Chris@0 19 * {@inheritdoc}
Chris@0 20 */
Chris@0 21 protected function configure() {
Chris@0 22 $this
Chris@0 23 ->setName('{{ command_name }}')
Chris@0 24 ->setDescription('{{ description }}');
Chris@0 25 }
Chris@0 26
Chris@0 27 /**
Chris@0 28 * {@inheritdoc}
Chris@0 29 */
Chris@0 30 protected function execute(InputInterface $input, OutputInterface $output) {
Chris@0 31 $io = new DrupalStyle($input, $output);
Chris@0 32
Chris@0 33 $io->info('It works!');
Chris@0 34 }
Chris@0 35
Chris@0 36 }