
| Current Path : /var/www/html/vendor/chi-teck/drupal-code-generator/src/Command/Service/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/vendor/chi-teck/drupal-code-generator/src/Command/Service/ThemeNegotiator.php |
<?php declare(strict_types=1);
namespace DrupalCodeGenerator\Command\Service;
use DrupalCodeGenerator\Application;
use DrupalCodeGenerator\Command\ModuleGenerator;
/**
* Implements service:theme-negotiator command.
*/
final class ThemeNegotiator extends ModuleGenerator {
protected string $name = 'service:theme-negotiator';
protected string $description = 'Generates a theme negotiator';
protected string $alias = 'theme-negotiator';
protected string $templatePath = Application::TEMPLATE_PATH . '/service/theme-negotiator';
/**
* {@inheritdoc}
*/
protected function generate(array &$vars): void {
$this->collectDefault($vars);
$vars['class'] = $this->ask('Class', '{machine_name|camelize}Negotiator');
$this->addFile('src/Theme/{class}.php', 'theme-negotiator');
$this->addServicesFile()->template('services');
}
}