Code Duplication    Length = 28-28 lines in 2 locations

lib/Service/MigrationService.php 2 locations

@@ 222-249 (lines=28) @@
219
	}
220
221
222
	private function migrationTo22_Circles(): void {
223
		$qb = $this->dbConnection->getQueryBuilder();
224
		$qb->select('*')->from('circle_circles');
225
226
		try {
227
			$cursor = $qb->executeQuery();
228
			$this->outputService->startMigrationProgress($cursor->rowCount());
229
230
			while ($row = $cursor->fetch()) {
231
				try {
232
					$data = new SimpleDataStore($row);
233
					$this->outputService->output(
234
						'Migrating Circle \'' . $data->g('name') . '\'',
235
						true
236
					);
237
238
					$circle = $this->generateCircleFrom21($data);
239
					$this->saveGeneratedCircle($circle);
240
				} catch (Exception $e) {
241
				}
242
			}
243
244
			$cursor->closeCursor();
245
		} catch (\OCP\DB\Exception $e) {
246
		}
247
248
		$this->outputService->finishMigrationProgress();
249
	}
250
251
252
	/**
@@ 327-354 (lines=28) @@
324
325
	/**
326
	 */
327
	private function migrationTo22_Members(): void {
328
		$qb = $this->dbConnection->getQueryBuilder();
329
		$qb->select('*')->from('circle_members');
330
331
		try {
332
			$cursor = $qb->executeQuery();
333
			$this->outputService->startMigrationProgress($cursor->rowCount());
334
335
			while ($row = $cursor->fetch()) {
336
				try {
337
					$data = new SimpleDataStore($row);
338
					$this->outputService->output(
339
						'Migrating Member \'' . $data->g('user_id') . '\'',
340
						true
341
					);
342
343
					$member = $this->generateMemberFrom21($data);
344
					$this->saveGeneratedMember($member);
345
				} catch (Exception $e) {
346
				}
347
			}
348
349
			$cursor->closeCursor();
350
		} catch (\OCP\DB\Exception $e) {
351
		}
352
353
		$this->outputService->finishMigrationProgress();
354
	}
355
356
357
	/**