Skip to content

Commit 549fe0e

Browse files
MRDI-16: Add code-rabbit suggestion
1 parent a985140 commit 549fe0e

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/Drush/Commands/UpdateDisplayHints.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,19 @@ public function updateDisplayHints(
116116

117117
$nodes = $this->entityTypeManager->getStorage('node')->loadMultiple(array_filter(array_map('trim', $nodeIds)));
118118
foreach ($nodes as $node) {
119-
foreach ($nodes as $node) {
120-
if (!$options['dry-run']) {
121-
$node->set('field_display_hints', $termId);
122-
$node->save();
123-
$this->messenger->addMessage($this->t('Updated display hints for @nid.', [
124-
'@nid' => $node->id(),
125-
]));
126-
}
127-
else {
128-
$this->messenger->addMessage($this->t('Would update display hints for @nid (dry run).', [
129-
'@nid' => $node->id(),
130-
]));
119+
if (!$options['dry-run']) {
120+
$node->set('field_display_hints', $termId);
121+
$node->save();
122+
$this->messenger->addMessage($this->t('Updated display hints for @nid.', [
123+
'@nid' => $node->id(),
124+
]));
125+
}
126+
else {
127+
$this->messenger->addMessage($this->t('Would update display hints for @nid (dry run).', [
128+
'@nid' => $node->id(),
129+
]));
130+
}
131131
}
132132
}
133-
}
134133

135134
}

0 commit comments

Comments
 (0)