diff --git a/src/Commands/PathautoCommands.php b/src/Commands/PathautoCommands.php index 28fd3b9..189b0c3 100644 --- a/src/Commands/PathautoCommands.php +++ b/src/Commands/PathautoCommands.php @@ -64,7 +64,7 @@ class PathautoCommands extends DrushCommands { /** * (Re)generate URL aliases. * - * @command pathauto-aliases-generate + * @command pathauto:aliases-generate * * @param string $action * The action to take. Possible actions are "create" (generate aliases for @@ -76,11 +76,11 @@ class PathautoCommands extends DrushCommands { * * @throws \Exception * - * @usage drush pathauto-aliases-generate all all + * @usage drush pathauto:aliases-generate all all * Generate all URL aliases. - * @usage drush pathauto-aliases-generate create canonical_entities:node + * @usage drush pathauto:aliases-generate create canonical_entities:node * Generate URL aliases for un-aliased node paths only. - * @usage drush pathauto-aliases-generate + * @usage drush pathauto:aliases-generate * When the arguments are omitted they can be chosen from an interactive * menu. * @@ -107,37 +107,37 @@ class PathautoCommands extends DrushCommands { /** * Delete URL aliases * - * @command pathauto-aliases-delete + * @command pathauto:aliases-delete * * @param array $types * Comma-separated list of alias types to delete. Pass "all" to delete * aliases for all types. * - * @option force - * Force deletion of all URL aliases, including manually created ones. + * @option purge + * Deletes all URL aliases, including manually created ones. * * @throws \Exception * - * @usage drush pathauto-aliases-delete canonical_entities:node + * @usage drush pathauto:aliases-delete canonical_entities:node * Delete all automatically generated URL aliases for node entities, * preserving manually created aliases. - * @usage drush pathauto-aliases-delete all + * @usage drush pathauto:aliases-delete all * Delete all automatically generated URL aliases, preserving manually * created ones. - * @usage drush pathauto-aliases-delete all --force + * @usage drush pathauto:aliases-delete all --purge * Delete all URL aliases, including manually created ones. - * @usage drush pathauto-aliases-delete + * @usage drush pathauto:aliases-delete * When the alias types are omitted they can be chosen from an interactive * menu. * * @aliases pad */ - public function deleteAliases(array $types = NULL, $options = ['force' => FALSE]) { + public function deleteAliases(array $types = NULL, $options = ['purge' => FALSE]) { $delete_all = count($types) === count($this->getAliasTypes()); // Keeping custom aliases forces us to go the slow way to correctly check // the automatic/manual flag. - if (!$options['force']) { + if (!$options['purge']) { $batch = [ 'title' => dt('Bulk deleting URL aliases'), 'operations' => [['Drupal\pathauto\Form\PathautoAdminDelete::batchStart', [$delete_all]]], @@ -157,6 +157,7 @@ class PathautoCommands extends DrushCommands { } else { foreach ($types as $type) { + /** @var \Drupal\pathauto\AliasTypeInterface $alias_type */ $alias_type = $this->aliasTypeManager->createInstance($type); $this->aliasStorageHelper->deleteBySourcePrefix((string) $alias_type->getSourcePrefix()); $this->logger()->success(dt('All of your %label path aliases have been deleted.', [ @@ -167,7 +168,7 @@ class PathautoCommands extends DrushCommands { } /** - * @hook interact pathauto-aliases-generate + * @hook interact pathauto:aliases-generate * * @throws \Drush\Exceptions\UserAbortException * Thrown when the user cancels the operation during CLI interaction. @@ -196,7 +197,7 @@ class PathautoCommands extends DrushCommands { } /** - * @hook validate pathauto-aliases-generate + * @hook validate pathauto:aliases-generate * * @throws \InvalidArgumentException * Thrown when one of the passed arguments is invalid