From cd2f89b52a902c0869b3280b51ef4066457ac5d7 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Thu, 6 Jun 2024 16:51:52 -0300 Subject: [PATCH] Coding standards. --- src/Util/MigrationRollbackBatch.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Util/MigrationRollbackBatch.php b/src/Util/MigrationRollbackBatch.php index b1f6890..67fed28 100644 --- a/src/Util/MigrationRollbackBatch.php +++ b/src/Util/MigrationRollbackBatch.php @@ -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; /** @@ -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); } /** @@ -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(), ]);