function PackageManagerUninstallValidator::validate

Overrides ModuleUninstallValidatorInterface::validate

File

core/modules/package_manager/src/PackageManagerUninstallValidator.php, line 46

Class

PackageManagerUninstallValidator
Prevents any module from being uninstalled if update is in process.

Namespace

Drupal\package_manager

Code

public function validate($module) {
    $stage = new class ($this->pathLocator, $this->beginner, $this->stager, $this->committer, $this->queueFactory, $this->eventDispatcher, $this->sharedTempStoreFactory, $this->time, $this->pathFactory, $this->failureMarker) extends StageBase {

};
    $reasons = [];
    if (!$stage->isAvailable() && $stage->isApplying()) {
        $reasons[] = $this->t('Modules cannot be uninstalled while Package Manager is applying staged changes to the active code base.');
    }
    return $reasons;
}

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