Skip to content

Commit

Permalink
Coding standards.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-vessey committed Jun 6, 2024
1 parent bf52db7 commit cd2f89b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Util/MigrationRollbackBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class MigrationRollbackBatch extends MigrateExecutable {
*/
protected QueueInterface $queue;

/**
* Flag if we should exclusively consider failed and ignored rows to rollback.
*
* @var bool
*/
protected bool $checkStatus;

/**
Expand All @@ -48,7 +53,7 @@ public function __construct(
array $options,
) {
parent::__construct($migration, $messenger, $options);
$this->checkStatus = $options['checkStatus'] ?? FALSE;
$this->checkStatus = (bool) ($options['checkStatus'] ?? FALSE);
}

/**
Expand Down Expand Up @@ -107,8 +112,9 @@ private function enqueue(): int {
$iterator = $this->checkStatus ?
new StatusFilter($id_map, StatusFilter::mapStatuses('failed,ignored')) :
$id_map;
foreach ($iterator as $_) {
foreach ($iterator as $row) {
$this->queue->createItem([
'iterator_value' => $row,
'destination' => $id_map->currentDestination(),
'source' => $id_map->currentSource(),
]);
Expand Down

0 comments on commit cd2f89b

Please sign in to comment.