Code Duplication    Length = 39-39 lines in 2 locations

lib/Command/Index.php 1 location

@@ 514-552 (lines=39) @@
511
	/**
512
	 * @param int $pos
513
	 */
514
	private function displayError($pos = 0) {
515
		$total = sizeof($this->errors);
516
517
		if ($total === 0) {
518
			$this->runner->setInfoArray(
519
				[
520
					'errorCurrent' => 0,
521
					'errorTotal'   => 0,
522
				]
523
			);
524
525
			return;
526
		}
527
528
		$current = key($this->errors) + 1;
529
		$error = $this->getNavigationError($pos, ($current === 1), ($current === $total));
530
		$current = key($this->errors) + 1;
531
532
		if ($error === false) {
533
			return;
534
		}
535
536
		/** @var ModelIndex $index */
537
		$index = $error['index'];
538
		$errorIndex = '';
539
		if ($index !== null) {
540
			$errorIndex = $index->getProviderId() . ':' . $index->getDocumentId();
541
		}
542
543
		$this->runner->setInfoArray(
544
			[
545
				'errorCurrent'   => $current,
546
				'errorTotal'     => $total,
547
				'errorMessage'   => MiscService::get('message', $error, ''),
548
				'errorException' => MiscService::get('exception', $error, ''),
549
				'errorIndex'     => $errorIndex
550
			]
551
		);
552
	}
553
554
555
	/**

lib/Command/Live.php 1 location

@@ 425-463 (lines=39) @@
422
	/**
423
	 * @param int $pos
424
	 */
425
	private function displayError($pos = 0) {
426
		$total = sizeof($this->errors);
427
428
		if ($total === 0) {
429
			$this->runner->setInfoArray(
430
				[
431
					'errorCurrent' => 0,
432
					'errorTotal'   => 0,
433
				]
434
			);
435
436
			return;
437
		}
438
439
		$current = key($this->errors) + 1;
440
		$error = $this->getNavigationError($pos, ($current === 1), ($current === $total));
441
		$current = key($this->errors) + 1;
442
443
		if ($error === false) {
444
			return;
445
		}
446
447
		/** @var ModelIndex $index */
448
		$index = $error['index'];
449
		$errorIndex = '';
450
		if ($index !== null) {
451
			$errorIndex = $index->getProviderId() . ':' . $index->getDocumentId();
452
		}
453
454
		$this->runner->setInfoArray(
455
			[
456
				'errorCurrent'   => $current,
457
				'errorTotal'     => $total,
458
				'errorMessage'   => MiscService::get('message', $error, ''),
459
				'errorException' => MiscService::get('exception', $error, ''),
460
				'errorIndex'     => $errorIndex
461
			]
462
		);
463
	}
464
465
466
	/**