class PhpUninstallValidator in PHP 8
Remove filter preventing Php uninstall.
Hierarchy
- class \Drupal\filter\FilterUninstallValidator implements ModuleUninstallValidatorInterface uses StringTranslationTrait
- class \Drupal\php\PhpUninstallValidator
Expanded class hierarchy of PhpUninstallValidator
1 string reference to 'PhpUninstallValidator'
1 service uses PhpUninstallValidator
File
- src/
PhpUninstallValidator.php, line 10
Namespace
Drupal\phpView source
class PhpUninstallValidator extends FilterUninstallValidator {
/**
* {@inheritdoc}
*/
public function validate($module) {
$reasons = [];
if ($module == 'php') {
$this
->removeFilterConfig();
}
return $reasons;
}
/**
* Deletes configuration.
*/
protected function removeFilterConfig() {
$php_filter = \Drupal::configFactory()
->getEditable('filter.format.php_code');
$php_filter
->delete();
// Clear cache.
drupal_flush_all_caches();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FilterUninstallValidator:: |
protected | property | The filter plugin manager. | |
FilterUninstallValidator:: |
protected | property | The filter entity storage. | |
FilterUninstallValidator:: |
protected | function | Returns all enabled filter formats. | |
FilterUninstallValidator:: |
protected | function | Returns all filter definitions that are provided by the specified provider. | |
FilterUninstallValidator:: |
public | function | Constructs a new FilterUninstallValidator. | |
PhpUninstallValidator:: |
protected | function | Deletes configuration. | |
PhpUninstallValidator:: |
public | function |
Determines the reasons a module can not be uninstalled. Overrides FilterUninstallValidator:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |