You are here

public function UserDevelGenerate::validateDrushParams in Devel 4.x

Same name and namespace in other branches
  1. 8.3 devel_generate/src/Plugin/DevelGenerate/UserDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\UserDevelGenerate::validateDrushParams()
  2. 8 devel_generate/src/Plugin/DevelGenerate/UserDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\UserDevelGenerate::validateDrushParams()
  3. 8.2 devel_generate/src/Plugin/DevelGenerate/UserDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\UserDevelGenerate::validateDrushParams()

Responsible for validating Drush params.

Parameters

array $args: The command arguments.

array $options: The commend options.

Return value

array An array of values ready to be used for generateElements().

Overrides DevelGenerateBaseInterface::validateDrushParams

File

devel_generate/src/Plugin/DevelGenerate/UserDevelGenerate.php, line 195

Class

UserDevelGenerate
Provides a UserDevelGenerate plugin.

Namespace

Drupal\devel_generate\Plugin\DevelGenerate

Code

public function validateDrushParams(array $args, array $options = []) {
  $values = [
    'num' => array_shift($args),
    'time_range' => 0,
    'roles' => StringUtils::csvToArray($options['roles']),
    'kill' => $options['kill'],
    'pass' => $options['pass'],
  ];
  return $values;
}