public function ModuleCommands::validateModule in Helper 8
Validation hook to check that a module name is valid.
If the argument to be validated is not named $module, pass the argument name as the value of the validate-module-name annotation.
@hook validate @validate-module
Parameters
\Consolidation\AnnotatedCommand\CommandData $commandData: The command data.
File
- src/
Commands/ ModuleCommands.php, line 316
Class
- ModuleCommands
- Drush commands for working with module schemas.
Namespace
Drupal\helper\CommandsCode
public function validateModule(CommandData $commandData) {
$arg_name = $commandData
->annotationData()
->get('validate-module-name', NULL) ?: 'module';
$module = $commandData
->input()
->getArgument($arg_name);
$this
->validateModuleInstalled($module);
}