Code Duplication    Length = 19-22 lines in 2 locations

lib/Command/CirclesRemote.php 2 locations

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