GenerateMenusCommand.php

Same filename in this branch
  1. 5.x devel_generate/src/Drush/Commands/GenerateMenusCommand.php

Namespace

Drupal\devel_generate\Command

File

devel_generate/src/Command/GenerateMenusCommand.php

View source
<?php

declare (strict_types=1);
namespace Drupal\devel_generate\Command;

use Symfony\Component\Console\Attribute\Argument;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Attribute\Option;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Create menus.
 */
class GenerateMenusCommand {
  use GenerateCommandTrait;
  public const NAME = 'devel-generate:menus';
  public const PLUGIN_ID = 'menu';
  
  /**
   * Create menus.
   *
   * The arguments and options are read from the input by the plugin.
   */
  public function __invoke(InputInterface $input, OutputInterface $output, #[Argument('Number of menus to generate.', name: 'number_menus')] string $numberMenus = '2', #[Argument('Number of links to generate.', name: 'number_links')] string $numberLinks = '50', #[Argument('Max link depth.', name: 'max_depth')] string $maxDepth = '3', #[Argument('Max width of first level of links.', name: 'max_width')] string $maxWidth = '8', #[Option('Delete any menus and menu links previously created by devel_generate before generating new ones.')] bool $kill = FALSE) : int {
    return $this->generate(self::PLUGIN_ID, $input, $output);
  }

}

Classes

Title Deprecated Summary
GenerateMenusCommand Create menus.