GenerateUsersCommand.php

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

Namespace

Drupal\devel_generate\Command

File

devel_generate/src/Command/GenerateUsersCommand.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 users.
 */
class GenerateUsersCommand {
  use GenerateCommandTrait;
  public const NAME = 'devel-generate:users';
  public const PLUGIN_ID = 'user';
  
  /**
   * Create users.
   *
   * The arguments and options are read from the input by the plugin.
   */
  public function __invoke(InputInterface $input, OutputInterface $output, #[Argument('Number of users to generate.')] string $num = '50', #[Option('Delete all users before generating new ones.')] bool $kill = FALSE, #[Option('A comma delimited list of role IDs for new users. Don\'t specify authenticated.')] ?string $roles = NULL, #[Option('Specify a password to be set for all generated users.')] ?string $pass = NULL) : int {
    return $this->generate(self::PLUGIN_ID, $input, $output);
  }

}

Classes

Title Deprecated Summary
GenerateUsersCommand Create users.