Code Duplication    Length = 19-22 lines in 2 locations

lib/Command/CirclesRemote.php 2 locations

@@ 324-342 (lines=19) @@
321
	 *
322
	 * @throws RemoteUidException
323
	 */
324
	private function saveRemote(RemoteInstance $remoteSignatory) {
325
		$this->output->writeln('');
326
		$helper = $this->getHelper('question');
327
328
		$this->output->writeln(
329
			'The remote instance <info>' . $remoteSignatory->getInstance() . '</info> looks good.'
330
		);
331
		$question = new ConfirmationQuestion(
332
			'Would you like to identify this remote instance as \'' . $remoteSignatory->getType()
333
			. '\' ? (y/N) ',
334
			false,
335
			'/^(y|Y)/i'
336
		);
337
338
		if ($helper->ask($this->input, $this->output, $question)) {
339
			$this->remoteRequest->save($remoteSignatory);
340
			$this->output->writeln('<info>remote instance saved</info>');
341
		}
342
	}
343
344
345
	/**
@@ 350-371 (lines=22) @@
347
	 *
348
	 * @throws RemoteUidException
349
	 */
350
	private function updateRemote(RemoteInstance $remoteSignatory): void {
351
		$this->output->writeln('');
352
		$helper = $this->getHelper('question');
353
354
		$this->output->writeln(
355
			'The remote instance <info>' . $remoteSignatory->getInstance()
356
			. '</info> is known but <error>its identity has changed.</error>'
357
		);
358
		$this->output->writeln(
359
			'<comment>If you are not sure on why identity changed, please say No to the next question and contact the admin of the remote instance</comment>'
360
		);
361
		$question = new ConfirmationQuestion(
362
			'Do you consider this new identity as valid and update the entry in the database? (y/N) ',
363
			false,
364
			'/^(y|Y)/i'
365
		);
366
367
		if ($helper->ask($this->input, $this->output, $question)) {
368
			$this->remoteStreamService->update($remoteSignatory);
369
			$this->output->writeln('remote instance updated');
370
		}
371
	}
372
373
374
	/**