function ModuleInstaller::validateUninstall

Same name in this branch
  1. 10 core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php \Drupal\Core\ProxyClass\Extension\ModuleInstaller::validateUninstall()
Same name in other branches
  1. 9 core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php \Drupal\Core\ProxyClass\Extension\ModuleInstaller::validateUninstall()
  2. 9 core/lib/Drupal/Core/Extension/ModuleInstaller.php \Drupal\Core\Extension\ModuleInstaller::validateUninstall()
  3. 8.9.x core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php \Drupal\Core\ProxyClass\Extension\ModuleInstaller::validateUninstall()
  4. 8.9.x core/lib/Drupal/Core/Extension/ModuleInstaller.php \Drupal\Core\Extension\ModuleInstaller::validateUninstall()
  5. 11.x core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php \Drupal\Core\ProxyClass\Extension\ModuleInstaller::validateUninstall()
  6. 11.x core/lib/Drupal/Core/Extension/ModuleInstaller.php \Drupal\Core\Extension\ModuleInstaller::validateUninstall()
1 call to ModuleInstaller::validateUninstall()
ModuleInstaller::uninstall in core/lib/Drupal/Core/Extension/ModuleInstaller.php

File

core/lib/Drupal/Core/Extension/ModuleInstaller.php, line 646

Class

ModuleInstaller
Default implementation of the module installer.

Namespace

Drupal\Core\Extension

Code

public function validateUninstall(array $module_list) {
    $reasons = [];
    foreach ($module_list as $module) {
        foreach ($this->uninstallValidators as $validator) {
            $validation_reasons = $validator->validate($module);
            if (!empty($validation_reasons)) {
                if (!isset($reasons[$module])) {
                    $reasons[$module] = [];
                }
                $reasons[$module] = array_merge($reasons[$module], $validation_reasons);
            }
        }
    }
    return $reasons;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.