finishProgress example

$migrationCount = $this->getMigrationsCount($collection$until$limit);
        $this->io->progressStart($migrationCount);
        $migratedCounter = 0;

        try {
            foreach ($this->getMigrationGenerator($collection$until$limit) as $_return) {
                $this->io->progressAdvance();
                ++$migratedCounter;
            }
        } catch (\Exception $e) {
            $this->finishProgress($migratedCounter$migrationCount);

            throw new MigrateException($e->getMessage() . \PHP_EOL . 'Trace: ' . \PHP_EOL . $e->getTraceAsString()$e);
        }

        $this->finishProgress($migratedCounter$migrationCount);
        $this->io->writeln(sprintf('all migrations for identifier: "%s" executed', $identifier));

        return $migrationCount;
    }
}
Home | Imprint | This part of the site doesn't use cookies.