public function DevelGenerateCommands::validate in Devel 4.x
Same name and namespace in other branches
- 8.3 devel_generate/src/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Commands\DevelGenerateCommands::validate()
- 8 devel_generate/src/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Commands\DevelGenerateCommands::validate()
- 8.2 devel_generate/src/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Commands\DevelGenerateCommands::validate()
The standard drush validate hook.
@hook validate
Parameters
\Consolidation\AnnotatedCommand\CommandData $commandData: The data sent from the drush command.
File
- devel_generate/
src/ Commands/ DevelGenerateCommands.php, line 265
Class
- DevelGenerateCommands
- Provide Drush commands for all the Devel Generate processes.
Namespace
Drupal\devel_generate\CommandsCode
public function validate(CommandData $commandData) {
$manager = $this
->getManager();
$args = $commandData
->input()
->getArguments();
// The command name is the first argument but we do not need this.
array_shift($args);
/* @var DevelGenerateBaseInterface $instance */
$instance = $manager
->createInstance($commandData
->annotationData()
->get('pluginId'), []);
$this
->setPluginInstance($instance);
$parameters = $instance
->validateDrushParams($args, $commandData
->input()
->getOptions());
$this
->setParameters($parameters);
}