Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / src / Commands / generate / Generators / Drush / default-methods.twig
diff --git a/vendor/drush/drush/src/Commands/generate/Generators/Drush/default-methods.twig b/vendor/drush/drush/src/Commands/generate/Generators/Drush/default-methods.twig
new file mode 100644 (file)
index 0000000..f2884cf
--- /dev/null
@@ -0,0 +1,48 @@
+  /**
+   * Command description here.
+   *
+   * @param $arg1
+   *   Argument description.
+   * @param array $options
+   *   An associative array of options whose values come from cli, aliases, config, etc.
+   * @option option-name
+   *   Description
+   * @usage {{ machine_name }}-commandName foo
+   *   Usage description
+   *
+   * @command {{ machine_name }}:commandName
+   * @aliases foo
+   */
+  public function commandName($arg1, $options = ['option-name' => 'default']) {
+    $this->logger()->success(dt('Achievement unlocked.'));
+  }
+
+  /**
+   * An example of the table output format.
+   *
+   * @param array $options An associative array of options whose values come from cli, aliases, config, etc.
+   *
+   * @field-labels
+   *   group: Group
+   *   token: Token
+   *   name: Name
+   * @default-fields group,token,name
+   *
+   * @command {{  machine_name }}:token
+   * @aliases token
+   *
+   * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields
+   */
+  public function token($options = ['format' => 'table']) {
+    $all = \Drupal::token()->getInfo();
+    foreach ($all['tokens'] as $group => $tokens) {
+      foreach ($tokens as $key => $token) {
+        $rows[] = [
+          'group' => $group,
+          'token' => $key,
+          'name' => $token['name'],
+        ];
+      }
+    }
+    return new RowsOfFields($rows);
+  }