4915e5655a4dcda0f6a4ce678b4ab468d6793e1c
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / Yml / Links / Action.php
1 <?php
2
3 namespace DrupalCodeGenerator\Command\Drupal_8\Yml\Links;
4
5 use DrupalCodeGenerator\Command\BaseGenerator;
6 use DrupalCodeGenerator\Utils;
7 use Symfony\Component\Console\Input\InputInterface;
8 use Symfony\Component\Console\Output\OutputInterface;
9 use Symfony\Component\Console\Question\Question;
10
11 /**
12  * Implements d8:yml:links:action command.
13  */
14 class Action extends BaseGenerator {
15
16   protected $name = 'd8:yml:links:action';
17   protected $description = 'Generates a links.action yml file';
18   protected $alias = 'action-links';
19
20   /**
21    * {@inheritdoc}
22    */
23   protected function interact(InputInterface $input, OutputInterface $output) {
24     $questions['machine_name'] = new Question('Module machine name');
25     $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']);
26
27     $this->collectVars($input, $output, $questions);
28
29     $this->addFile()
30       ->path('{machine_name}.links.action.yml')
31       ->template('d8/yml/links.action.twig');
32   }
33
34 }