diff --git a/core/lib/Drupal/Core/Extension/RequiredModuleUninstallValidator.php b/core/lib/Drupal/Core/Extension/RequiredModuleUninstallValidator.php index 09c72c3..5ce8a48 100644 --- a/core/lib/Drupal/Core/Extension/RequiredModuleUninstallValidator.php +++ b/core/lib/Drupal/Core/Extension/RequiredModuleUninstallValidator.php @@ -18,6 +18,8 @@ class RequiredModuleUninstallValidator implements ModuleUninstallValidatorInterf use StringTranslationTrait; /** + * Constructs a new RequiredModuleUninstallValidator. + * * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * The string translation service. */ diff --git a/core/modules/book/src/BookUninstallValidator.php b/core/modules/book/src/BookUninstallValidator.php index 5a7a1cd..6a686c3 100644 --- a/core/modules/book/src/BookUninstallValidator.php +++ b/core/modules/book/src/BookUninstallValidator.php @@ -35,6 +35,8 @@ class BookUninstallValidator implements ModuleUninstallValidatorInterface { protected $entityQuery; /** + * Constructs a new BookUninstallValidator. + * * @param \Drupal\book\BookOutlineStorageInterface $book_outline_storage * The book outline storage. * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory @@ -54,12 +56,12 @@ public function __construct(BookOutlineStorageInterface $book_outline_storage, Q public function validate($module) { $reasons = []; if ($module == 'book') { - if ($this->hasOutlineBooks()) { + if ($this->hasBookOutlines()) { $reasons[] = $this->t('To uninstall Book, delete all content that is part of a book.'); } else { - // The book node type is provided by the Book module. Prevent uninstall if - // there are any nodes of that type. + // The book node type is provided by the Book module. Prevent uninstall + // if there are any nodes of that type. if ($this->hasBookNodes()) { $reasons[] = $this->t('To uninstall Book, delete all content that has the Book content type.'); } @@ -74,12 +76,12 @@ public function validate($module) { * @return bool * TRUE if there are books, FALSE if not. */ - protected function hasOutlineBooks() { + protected function hasBookOutlines() { return $this->bookOutlineStorage->hasBooks(); } /** - * Determines if there are any book nodes or not. + * Determines if there is any book nodes or not. * * @return bool * TRUE if there are book nodes, FALSE otherwise. diff --git a/core/modules/config/src/Tests/ConfigImportAllTest.php b/core/modules/config/src/Tests/ConfigImportAllTest.php index 0cedbfd..21312bc 100644 --- a/core/modules/config/src/Tests/ConfigImportAllTest.php +++ b/core/modules/config/src/Tests/ConfigImportAllTest.php @@ -108,7 +108,8 @@ public function testInstallUninstall() { // Can not uninstall config and use admin/config/development/configuration! unset($modules_to_uninstall['config']); - // Can not uninstall editor and its dependencies as it provides filter plugins. + // Can not uninstall Editor and Filter and their dependencies as they + // provide filter plugins that can not be removed. unset($modules_to_uninstall['editor']); unset($modules_to_uninstall['filter']); unset($modules_to_uninstall['file']); diff --git a/core/modules/field/src/FieldUninstallValidator.php b/core/modules/field/src/FieldUninstallValidator.php index 51f8640..3b3fbd5 100644 --- a/core/modules/field/src/FieldUninstallValidator.php +++ b/core/modules/field/src/FieldUninstallValidator.php @@ -22,11 +22,13 @@ class FieldUninstallValidator implements ModuleUninstallValidatorInterface { /** * The field storage config storage. * - * @var \Drupal\Core\Entity\EntityStorageInterface + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface */ protected $fieldStorageConfigStorage; /** + * Constructs a new FieldUninstallValidator. + * * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation @@ -44,7 +46,7 @@ public function validate($module) { $reasons = []; if ($field_storages = $this->getFieldStoragesByModule($module)) { // Provide an explanation message (only mention pending deletions if there - // remains no actual, non-deleted fields) + // remain no actual, non-deleted fields.) $non_deleted = FALSE; foreach ($field_storages as $field_storage) { if (!$field_storage->isDeleted()) { @@ -53,10 +55,10 @@ public function validate($module) { } } if ($non_deleted) { - $reasons[] = $this->t('Fields type(s) in use'); + $reasons[] = $this->t('Fields type(s) in use.'); } else { - $reasons[] = $this->t('Fields pending deletion'); + $reasons[] = $this->t('Fields pending deletion.'); } } return $reasons; diff --git a/core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php b/core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php index ea9e0c8..4de38b9 100644 --- a/core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php +++ b/core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php @@ -61,7 +61,7 @@ public function testValidateDeleted() { ->willReturn([$field_storage]); $module = $this->randomMachineName(); - $expected = ['Fields pending deletion']; + $expected = ['Fields pending deletion.']; $reasons = $this->fieldUninstallValidator->validate($module); $this->assertSame($expected, $reasons); } @@ -81,7 +81,7 @@ public function testValidateNoDeleted() { ->willReturn([$field_storage]); $module = $this->randomMachineName(); - $expected = ['Fields type(s) in use']; + $expected = ['Fields type(s) in use.']; $reasons = $this->fieldUninstallValidator->validate($module); $this->assertSame($expected, $reasons); } diff --git a/core/modules/filter/src/FilterUninstallValidator.php b/core/modules/filter/src/FilterUninstallValidator.php index 3c0ecf6..6ab52f5 100644 --- a/core/modules/filter/src/FilterUninstallValidator.php +++ b/core/modules/filter/src/FilterUninstallValidator.php @@ -14,8 +14,7 @@ use Drupal\Core\StringTranslation\TranslationInterface; /** - * Prevents uninstallation of modules that provide filter plugins that are being - * used in a filter format. + * Prevents uninstallation of modules providing used filter plugins. */ class FilterUninstallValidator implements ModuleUninstallValidatorInterface { @@ -31,11 +30,13 @@ class FilterUninstallValidator implements ModuleUninstallValidatorInterface { /** * The filter entity storage. * - * @var \Drupal\Core\Entity\EntityStorageInterface + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface */ protected $filterStorage; /** + * Constructs a new FilterUninstallValidator. + * * @param \Drupal\Component\Plugin\PluginManagerInterface $filter_manager * The filter plugin manager. * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager @@ -68,7 +69,7 @@ public function validate($module) { } } if (!empty($used_in)) { - $reasons[] = $this->t('Provides a filter plugin that is in use in the following filter formats: %formats', ['%formats' => implode(', ', $used_in)]); + $reasons[] = $this->t('Provides a filter plugin that is in use in the following filter formats: %formats.', ['%formats' => implode(', ', $used_in)]); } } return $reasons; diff --git a/core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php b/core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php index bc516d2..e9afa81 100644 --- a/core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php +++ b/core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php @@ -160,7 +160,7 @@ public function testValidateNoMatchingFormats() { ]); $expected = [ - String::format('Provides a filter plugin that is in use in the following filter formats: %formats', ['%formats' => implode(', ', [ + String::format('Provides a filter plugin that is in use in the following filter formats: %formats.', ['%formats' => implode(', ', [ 'Filter Format 1 Label', 'Filter Format 2 Label', ])]), diff --git a/core/modules/forum/src/ForumUninstallValidator.php b/core/modules/forum/src/ForumUninstallValidator.php index d1aedec..8a09583 100644 --- a/core/modules/forum/src/ForumUninstallValidator.php +++ b/core/modules/forum/src/ForumUninstallValidator.php @@ -26,7 +26,7 @@ class ForumUninstallValidator implements ModuleUninstallValidatorInterface { /** * The field storage config storage. * - * @var \Drupal\Core\Entity\EntityStorageInterface + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface */ protected $vocabularyStorage; @@ -45,6 +45,8 @@ class ForumUninstallValidator implements ModuleUninstallValidatorInterface { protected $configFactory; /** + * Constructs a new ForumUninstallValidator. + * * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory @@ -68,19 +70,19 @@ public function validate($module) { $reasons = []; if ($module == 'forum') { if ($this->hasForumNodes()) { - $reasons[] = $this->t('To uninstall Forum first delete all Forum content.'); + $reasons[] = $this->t('To uninstall Forum, first delete all Forum content.'); } $vocabulary = $this->getForumVocabulary(); if ($this->hasTermsForVocabulary($vocabulary)) { if ($vocabulary->access('view')) { - $reasons[] = $this->t('To uninstall Forum first delete all %vocabulary terms.', [ + $reasons[] = $this->t('To uninstall Forum, first delete all %vocabulary terms.', [ '%vocabulary' => $vocabulary->label(), '!url' => $vocabulary->url('overview-form'), ]); } else { - $reasons[] = $this->t('To uninstall Forum first delete all %vocabulary terms.', [ + $reasons[] = $this->t('To uninstall Forum, first delete all %vocabulary terms.', [ '%vocabulary' => $vocabulary->label() ]); } diff --git a/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php b/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php index 3ac6196..3d36366 100644 --- a/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php +++ b/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php @@ -92,7 +92,7 @@ public function testValidateHasForumNodes() { $module = 'forum'; $expected = [ - 'To uninstall Forum first delete all Forum content.', + 'To uninstall Forum, first delete all Forum content.', ]; $reasons = $this->forumUninstallValidator->validate($module); $this->assertSame($expected, $reasons); @@ -126,7 +126,7 @@ public function testValidateHasTermsForVocabularyWithNodesAccess() { $module = 'forum'; $expected = [ - 'To uninstall Forum first delete all Forum content.', + 'To uninstall Forum, first delete all Forum content.', String::format('To uninstall Forum first delete all %vocabulary terms.', [ '!url' => '/path/to/vocabulary/overview', '%vocabulary' => 'Vocabulary label', @@ -163,7 +163,7 @@ public function testValidateHasTermsForVocabularyWithNodesNoAccess() { $module = 'forum'; $expected = [ - 'To uninstall Forum first delete all Forum content.', + 'To uninstall Forum, first delete all Forum content.', String::format('To uninstall Forum first delete all %vocabulary terms.', [ '%vocabulary' => 'Vocabulary label', ]), @@ -200,7 +200,7 @@ public function testValidateHasTermsForVocabularyAccess() { $module = 'forum'; $expected = [ - String::format('To uninstall Forum first delete all %vocabulary terms.', [ + String::format('To uninstall Forum, first delete all %vocabulary terms.', [ '!url' => '/path/to/vocabulary/overview', '%vocabulary' => 'Vocabulary label', ]), @@ -236,7 +236,7 @@ public function testValidateHasTermsForVocabularyNoAccess() { $module = 'forum'; $expected = [ - String::format('To uninstall Forum first delete all %vocabulary terms.', [ + String::format('To uninstall Forum, first delete all %vocabulary terms.', [ '%vocabulary' => 'Vocabulary label', ]), ];