Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / Service / PathProcessor.php
diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/PathProcessor.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Service/PathProcessor.php
new file mode 100644 (file)
index 0000000..7f10e36
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace DrupalCodeGenerator\Command\Drupal_8\Service;
+
+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:service:path-processor command.
+ */
+class PathProcessor extends BaseGenerator {
+
+  protected $name = 'd8:service:path-processor';
+  protected $description = 'Generates a path processor service';
+  protected $alias = 'path-processor';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function interact(InputInterface $input, OutputInterface $output) {
+    $questions = Utils::defaultQuestions();
+    $default_class = function ($vars) {
+      return Utils::camelize('PathProcessor' . $vars['name']);
+    };
+    $questions['class'] = new Question('Class', $default_class);
+
+    $this->collectVars($input, $output, $questions);
+
+    $this->addFile()
+      ->path('src/PathProcessor/{class}.php')
+      ->template('d8/service/path-processor.twig');
+
+    $this->addServicesFile()
+      ->template('d8/service/path-processor.services.twig');
+  }
+
+}