<?php

namespace {{ namespace }};

use DrupalCodeGenerator\Command\ModuleGenerator;

/**
 * Implements {{ command_name }} command.
 */
class {{ class }} extends ModuleGenerator {

  protected string $name = '{{ command_name }}';
  protected string $description = '{{ description }}';
  protected string $alias = '{{ alias }}';
  protected string $templatePath = __DIR__;

  /**
   * {@inheritdoc}
   */
  protected function generate(array &$vars) :void {
    $this->collectDefault($vars);
    $vars['class'] = $this->ask('Class', '{machine_name|camelize}');

    // @DCG The template should be located under directory specified in
    // $this->templatePath variable.
    $this->addFile()
      ->path('src/{class}.php')
      ->template('{{ template_name }}');
  }

}
