Code Duplication    Length = 10-11 lines in 4 locations

core/Command/User/SyncBackend.php 4 locations

@@ 288-298 (lines=11) @@
285
		} else {
286
			$output->writeln('Following users are no longer known with the connected backend.');
287
			switch ($missingAccountsAction) {
288
				case 'disable':
289
					$output->writeln('Proceeding to disable the accounts');
290
					$this->doActionForAccountUids($unknownUsers,
291
						function ($uid, IUser $ac) use ($output) {
292
							$ac->setEnabled(false);
293
							$output->writeln($uid);
294
						},
295
						function ($uid) use ($output) {
296
							$output->writeln("$uid (unknown account for the user)");
297
						});
298
					break;
299
				case 'remove':
300
					$output->writeln('Proceeding to remove the accounts');
301
					$this->doActionForAccountUids($unknownUsers,
@@ 299-309 (lines=11) @@
296
							$output->writeln("$uid (unknown account for the user)");
297
						});
298
					break;
299
				case 'remove':
300
					$output->writeln('Proceeding to remove the accounts');
301
					$this->doActionForAccountUids($unknownUsers,
302
						function ($uid, IUser $ac) use ($output) {
303
							$ac->delete();
304
							$output->writeln($uid);
305
						},
306
						function ($uid) use ($output) {
307
							$output->writeln("$uid (unknown account for the user)");
308
						});
309
					break;
310
				case 'ask later':
311
					$output->writeln('listing the unknown accounts');
312
					$this->doActionForAccountUids($unknownUsers,
@@ 329-338 (lines=10) @@
326
					$missingAccountsAction2 = $helper->ask($input, $output, $question);
327
					switch ($missingAccountsAction2) {
328
						// if "nothing" is selected, just ignore and finish
329
						case 'disable':
330
							$output->writeln('Proceeding to disable the accounts');
331
							$this->doActionForAccountUids($unknownUsers,
332
								function ($uid, IUser $ac) {
333
									$ac->setEnabled(false);
334
								},
335
								function ($uid) use ($output) {
336
									$output->writeln("$uid (unknown account for the user)");
337
								});
338
							break;
339
						case 'remove':
340
							$output->writeln('Proceeding to remove the accounts');
341
							$this->doActionForAccountUids($unknownUsers,
@@ 339-348 (lines=10) @@
336
									$output->writeln("$uid (unknown account for the user)");
337
								});
338
							break;
339
						case 'remove':
340
							$output->writeln('Proceeding to remove the accounts');
341
							$this->doActionForAccountUids($unknownUsers,
342
								function ($uid, IUser $ac) {
343
									$ac->delete();
344
								},
345
								function ($uid) use ($output) {
346
									$output->writeln("$uid (unknown account for the user)");
347
								});
348
							break;
349
					}
350
					break;
351
			}