Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / ThemeSettings.php
1 <?php
2
3 namespace DrupalCodeGenerator\Command\Drupal_8;
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:theme-settings command.
13  */
14 class ThemeSettings extends BaseGenerator {
15
16   protected $name = 'd8:theme-settings';
17   protected $description = 'Generates Drupal 8 theme-settings.php file';
18   protected $alias = 'theme-settings';
19   protected $destination = 'themes/%';
20
21   /**
22    * {@inheritdoc}
23    */
24   protected function interact(InputInterface $input, OutputInterface $output) {
25     $questions['name'] = new Question('Theme name');
26     $questions['name']->setValidator([Utils::class, 'validateRequired']);
27     $questions['machine_name'] = new Question('Theme machine name');
28     $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']);
29     $this->collectVars($input, $output, $questions);
30
31     $this->addFile()
32       ->path('theme-settings.php')
33       ->template('d8/theme-settings-form.twig');
34
35     $this->addFile()
36       ->path('config/install/{machine_name}.settings.yml')
37       ->template('d8/theme-settings-config.twig');
38
39     $this->addFile()
40       ->path('config/schema/{machine_name}.schema.yml')
41       ->template('d8/theme-settings-schema.twig');
42   }
43
44 }