Code Duplication    Length = 44-44 lines in 2 locations

lib/Command/Index.php 1 location

@@ 781-824 (lines=44) @@
778
	/**
779
	 *
780
	 */
781
	private function deleteError() {
782
		$current = current($this->errors);
783
		if ($current === false) {
784
			return;
785
		}
786
787
		$this->runner->setInfoArray(
788
			[
789
				'errorMessageA'  => '',
790
				'errorMessageB'  => '',
791
				'errorMessageC'  => '',
792
				'errorException' => '',
793
				'errorIndex'     => ''
794
			]
795
		);
796
797
		$pos = key($this->errors);
798
799
		/** @var ModelIndex $index */
800
		$index = $current['index'];
801
		$this->indexService->resetErrorFromIndex($index);
802
803
		$errors = [];
804
		foreach ($this->errors as $error) {
805
			/** @var ModelIndex $errorIndex */
806
			$errorIndex = $error['index'];
807
			if ($index->getProviderId() === $errorIndex->getProviderId()
808
				&& $index->getDocumentId() === $errorIndex->getDocumentId()) {
809
				continue;
810
			}
811
812
			$errors[] = $error;
813
		}
814
815
		$this->errors = $errors;
816
		while (key($this->errors) < $pos) {
817
			if (next($this->errors) === false) {
818
				end($this->errors);
819
				break;
820
			}
821
		}
822
823
		$this->displayError();
824
	}
825
826
}
827

lib/Command/Live.php 1 location

@@ 680-723 (lines=44) @@
677
	/**
678
	 *
679
	 */
680
	private function deleteError() {
681
		$current = current($this->errors);
682
		if ($current === false) {
683
			return;
684
		}
685
686
		$this->runner->setInfoArray(
687
			[
688
				'errorMessageA'  => '',
689
				'errorMessageB'  => '',
690
				'errorMessageC'  => '',
691
				'errorException' => '',
692
				'errorIndex'     => ''
693
			]
694
		);
695
696
		$pos = key($this->errors);
697
698
		/** @var ModelIndex $index */
699
		$index = $current['index'];
700
		$this->indexService->resetErrorFromIndex($index);
701
702
		$errors = [];
703
		foreach ($this->errors as $error) {
704
			/** @var ModelIndex $errorIndex */
705
			$errorIndex = $error['index'];
706
			if ($index->getProviderId() === $errorIndex->getProviderId()
707
				&& $index->getDocumentId() === $errorIndex->getDocumentId()) {
708
				continue;
709
			}
710
711
			$errors[] = $error;
712
		}
713
714
		$this->errors = $errors;
715
		while (key($this->errors) < $pos) {
716
			if (next($this->errors) === false) {
717
				end($this->errors);
718
				break;
719
			}
720
		}
721
722
		$this->displayError();
723
	}
724
}
725
726