Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / Yml / Links / Task.php
diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Task.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Links/Task.php
new file mode 100644 (file)
index 0000000..26dbdb2
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace DrupalCodeGenerator\Command\Drupal_8\Yml\Links;
+
+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:links:task command.
+ */
+class Task extends BaseGenerator {
+
+  protected $name = 'd8:yml:links:task';
+  protected $description = 'Generates a links.task yml file';
+  protected $alias = 'task-links';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function interact(InputInterface $input, OutputInterface $output) {
+    $questions['machine_name'] = new Question('Module machine name');
+    $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']);
+
+    $this->collectVars($input, $output, $questions);
+
+    $this->addFile()
+      ->path('{machine_name}.links.task.yml')
+      ->template('d8/yml/links.task.twig');
+  }
+
+}