Code Duplication    Length = 19-22 lines in 2 locations

lib/Command/CirclesRemote.php 2 locations

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