You are here

protected function ModuleCommands::validateModuleInstalled in Helper 8

Validates that a module is valid and installed.

Parameters

string $module: The module name.

Throws

\InvalidArgumentException If the module is not installed.

3 calls to ModuleCommands::validateModuleInstalled()
ModuleCommands::interactResetPostUpdate in src/Commands/ModuleCommands.php
Interaction hook for the module:post-update:reset command.
ModuleCommands::interactSchemaVersion in src/Commands/ModuleCommands.php
Sets the schema version for module.
ModuleCommands::validateModule in src/Commands/ModuleCommands.php
Validation hook to check that a module name is valid.

File

src/Commands/ModuleCommands.php, line 331

Class

ModuleCommands
Drush commands for working with module schemas.

Namespace

Drupal\helper\Commands

Code

protected function validateModuleInstalled($module) {
  if (\Drupal::keyValue('system.schema')
    ->get($module) === NULL) {
    throw new \InvalidArgumentException(dt('The !module module is not installed.', [
      '!module' => $module,
    ]));
  }
}