comparison vendor/chi-teck/drupal-code-generator/templates/other/drupal-console-command.twig @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php
2
3 namespace Drupal\{{ machine_name }}\Command;
4
5 use Drupal\Console\Command\Shared\{{ command_trait }};
6 use Drupal\Console\Style\DrupalStyle;
7 use Symfony\Component\Console\Command\Command;
8 use Symfony\Component\Console\Input\InputInterface;
9 use Symfony\Component\Console\Output\OutputInterface;
10
11 /**
12 * Implements {{ command_name }} command.
13 */
14 class {{ class }} extends Command {
15
16 use {{ command_trait }};
17
18 /**
19 * {@inheritdoc}
20 */
21 protected function configure() {
22 $this
23 ->setName('{{ command_name }}')
24 ->setDescription('{{ description }}');
25 }
26
27 /**
28 * {@inheritdoc}
29 */
30 protected function execute(InputInterface $input, OutputInterface $output) {
31 $io = new DrupalStyle($input, $output);
32
33 $io->info('It works!');
34 }
35
36 }