diff --git a/src/Migration/Transfer.php b/src/Migration/Transfer.php index 8445bc0..0172de9 100644 --- a/src/Migration/Transfer.php +++ b/src/Migration/Transfer.php @@ -88,13 +88,6 @@ public function getStatusCounters() ]; } - foreach ($this->cache->getAll() as $resources) { - foreach ($resources as $resource) { - /** @var resource $resource */ - $status[$resource->getName()][$resource->getStatus()]++; - } - } - if ($this->source->previousReport) { foreach ($this->source->previousReport as $resource => $data) { if ($resource != 'size' && $resource != 'version' && isset($status[$resource])) { @@ -103,6 +96,16 @@ public function getStatusCounters() } } + foreach ($this->cache->getAll() as $resources) { + foreach ($resources as $resource) { + /** @var resource $resource */ + $status[$resource->getName()][$resource->getStatus()]++; + if ($status[$resource->getName()]['pending'] > 0) { + $status[$resource->getName()]['pending']--; + } + } + } + // Remove all empty resources foreach ($status as $resource => $data) { $allEmpty = true;