devel_wizard-2.x-dev/src/Commands/ThemeClaroSpellCommands.php

src/Commands/ThemeClaroSpellCommands.php
<?php

declare(strict_types=1);

namespace Drupal\devel_wizard\Commands;

use Drush\Attributes as CLI;
use Drush\Boot\DrupalBootLevels;

class ThemeClaroSpellCommands extends SpellCommandsBase {

  /**
   * @noinspection PhpUnusedParameterInspection
   */
  #[CLI\Help(
    description: 'Generates a new theme based on Claro.',
  )]
  #[CLI\Command(name: 'devel-wizard:spell:devel_wizard_theme_claro')]
  #[CLI\Bootstrap(level: DrupalBootLevels::FULL)]
  #[CLI\Argument(
    name: 'machineName',
    description: 'Machine-name of the new theme.',
  )]
  public function cmdThemeClaroExecute(string $machineName): void {
    $this->execute();
  }

  protected function buildSpellConfigurationFromInput(): array {
    $input = $this->input();
    $spellId = $this->getSpellIdFromInput();

    return match ($spellId) {
      'devel_wizard_theme_claro' => [
        'machineNameLowerUnderscore' => $input->getArgument('machineName'),
      ],
      default => [],
    };
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc