From d8d4ef621aab1d4b247a08b91d900ab359df9533 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Mon, 18 Nov 2024 16:32:02 -0400 Subject: [PATCH] Misc unrelated coding standards bits. Due to the sniffs being updated? --- src/Drush/Commands/Deleter.php | 29 ++++++++++--------- src/Drush/Commands/GenerateThumbnails.php | 12 ++++---- src/Drush/Commands/NullChildWeight.php | 9 ++++-- .../Commands/PublishUnpublishCollections.php | 11 ++++--- src/Drush/Commands/Rederive.php | 8 +++-- src/Drush/Commands/Traits/LoggingTrait.php | 2 +- 6 files changed, 42 insertions(+), 29 deletions(-) diff --git a/src/Drush/Commands/Deleter.php b/src/Drush/Commands/Deleter.php index 131b655..c0132d7 100644 --- a/src/Drush/Commands/Deleter.php +++ b/src/Drush/Commands/Deleter.php @@ -76,11 +76,11 @@ class Deleter extends DrushCommands implements ContainerInjectionInterface { * Constructor. */ public function __construct( - protected EntityTypeManagerInterface $entityTypeManager, - protected QueueFactory $queueFactory, - protected Connection $database, - protected EntityFieldManagerInterface $entityFieldManager - ) { + protected EntityTypeManagerInterface $entityTypeManager, + protected QueueFactory $queueFactory, + protected Connection $database, + protected EntityFieldManagerInterface $entityFieldManager, + ) { parent::__construct(); $this->queuePrefix = implode( @@ -169,10 +169,13 @@ public function __wakeup() { * themselves. * @islandora-drush-utils-user-wrap */ - public function deleteRecursively(string $ids, array $options = [ - 'empty' => FALSE, - 'dry-run' => FALSE, - ]): void { + public function deleteRecursively( + string $ids, + array $options = [ + 'empty' => FALSE, + 'dry-run' => FALSE, + ], + ): void { $this->options = $options; foreach (explode(',', $ids) as $id) { $this->enqueueTraversal( @@ -531,10 +534,10 @@ protected function formatCallable(callable $callable) { * Additional replacements to be applied to the $template string. */ protected function deleteTranslations( - TranslatableInterface $entity, - string $template = 'Deleting {lang} translation of {entity_type} {id}.', - array $replacements = [] - ): void { + TranslatableInterface $entity, + string $template = 'Deleting {lang} translation of {entity_type} {id}.', + array $replacements = [], + ): void { foreach (array_keys($entity->getTranslationLanguages(FALSE)) as $langcode) { $this->log( $template, $replacements + [ diff --git a/src/Drush/Commands/GenerateThumbnails.php b/src/Drush/Commands/GenerateThumbnails.php index 461e9c5..808f4ae 100644 --- a/src/Drush/Commands/GenerateThumbnails.php +++ b/src/Drush/Commands/GenerateThumbnails.php @@ -62,11 +62,13 @@ public static function create(ContainerInterface $container) { * * @islandora-drush-utils-user-wrap */ - public function rederive(array $options = [ - 'nids' => self::REQ, - 'bundle' => 'islandora_object', - 'model' => self::REQ, - ]) { + public function rederive( + array $options = [ + 'nids' => self::REQ, + 'bundle' => 'islandora_object', + 'model' => self::REQ, + ], + ) { $entities = []; if (is_null($options['nids'])) { diff --git a/src/Drush/Commands/NullChildWeight.php b/src/Drush/Commands/NullChildWeight.php index a879be7..d0e7eab 100644 --- a/src/Drush/Commands/NullChildWeight.php +++ b/src/Drush/Commands/NullChildWeight.php @@ -71,9 +71,12 @@ public static function create(ContainerInterface $container) : self { * * @islandora-drush-utils-user-wrap */ - public function update(string $parent_nid, array $options = [ - 'dry-run' => FALSE, - ]) : void { + public function update( + string $parent_nid, + array $options = [ + 'dry-run' => FALSE, + ], + ) : void { $this->options = $options; // XXX: Determine whether this parent has children that are heterogeneous diff --git a/src/Drush/Commands/PublishUnpublishCollections.php b/src/Drush/Commands/PublishUnpublishCollections.php index ec92da7..0d71a18 100644 --- a/src/Drush/Commands/PublishUnpublishCollections.php +++ b/src/Drush/Commands/PublishUnpublishCollections.php @@ -65,10 +65,13 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Isl * @command islandora_drush_utils:update-status * @aliases idr:us */ - public function updateStatus(string $ancestor_nids, array $options = [ - 'publish' => FALSE, - 'batchSize' => 100, - ]) { + public function updateStatus( + string $ancestor_nids, + array $options = [ + 'publish' => FALSE, + 'batchSize' => 100, + ], + ) { $ancestor_nids = explode(',', $ancestor_nids); $batch = [ diff --git a/src/Drush/Commands/Rederive.php b/src/Drush/Commands/Rederive.php index c67acde..1e19531 100644 --- a/src/Drush/Commands/Rederive.php +++ b/src/Drush/Commands/Rederive.php @@ -52,9 +52,11 @@ public static function create(ContainerInterface $container) : self { * * @islandora-drush-utils-user-wrap */ - public function rederive(array $options = [ - 'source_uri' => 'http://pcdm.org/use#OriginalFile', - ]) : void { + public function rederive( + array $options = [ + 'source_uri' => 'http://pcdm.org/use#OriginalFile', + ], + ) : void { $original_file_taxonomy_ids = $this->entityTypeManager->getStorage('taxonomy_term') ->getQuery() ->condition('field_external_uri', $options['source_uri']) diff --git a/src/Drush/Commands/Traits/LoggingTrait.php b/src/Drush/Commands/Traits/LoggingTrait.php index 88327ca..329a057 100644 --- a/src/Drush/Commands/Traits/LoggingTrait.php +++ b/src/Drush/Commands/Traits/LoggingTrait.php @@ -2,8 +2,8 @@ namespace Drupal\islandora_drush_utils\Drush\Commands\Traits; -use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; +use Psr\Log\LoggerInterface; /** * Logging helper.