Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / Yml / ModuleInfo.php
diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleInfo.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/ModuleInfo.php
new file mode 100644 (file)
index 0000000..00784d8
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace DrupalCodeGenerator\Command\Drupal_8\Yml;
+
+use DrupalCodeGenerator\Command\BaseGenerator;
+use DrupalCodeGenerator\Utils;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Question\Question;
+
+/**
+ * Implements d8:yml:module-info command.
+ */
+class ModuleInfo extends BaseGenerator {
+
+  protected $name = 'd8:yml:module-info';
+  protected $description = 'Generates a module info yml file';
+  protected $alias = 'module-info';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function interact(InputInterface $input, OutputInterface $output) {
+    $questions = Utils::defaultQuestions();
+    $questions['description'] = new Question('Description', 'Module description.');
+    $questions['package'] = new Question('Package', 'Custom');
+    $questions['configure'] = new Question('Configuration page (route name)');
+    $questions['dependencies'] = new Question('Dependencies (comma separated)');
+
+    $vars = &$this->collectVars($input, $output, $questions);
+    if ($vars['dependencies']) {
+      $vars['dependencies'] = array_map('trim', explode(',', strtolower($vars['dependencies'])));
+    }
+
+    $this->addFile()
+      ->path('{machine_name}.info.yml')
+      ->template('d8/yml/module-info.twig');
+  }
+
+}