Skip to content

Commit

Permalink
Misc unrelated coding standards bits.
Browse files Browse the repository at this point in the history
Due to the sniffs being updated?
  • Loading branch information
adam-vessey committed Nov 18, 2024
1 parent 42d0fed commit d8d4ef6
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 29 deletions.
29 changes: 16 additions & 13 deletions src/Drush/Commands/Deleter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 + [
Expand Down
12 changes: 7 additions & 5 deletions src/Drush/Commands/GenerateThumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down
9 changes: 6 additions & 3 deletions src/Drush/Commands/NullChildWeight.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions src/Drush/Commands/PublishUnpublishCollections.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
8 changes: 5 additions & 3 deletions src/Drush/Commands/Rederive.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion src/Drush/Commands/Traits/LoggingTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d8d4ef6

Please sign in to comment.