Code Duplication    Length = 12-12 lines in 3 locations

includes/deferred/LinksUpdate.php 3 locations

@@ 675-686 (lines=12) @@
672
	 * @param array $existing
673
	 * @return array
674
	 */
675
	private function getLinkDeletions( $existing ) {
676
		$del = [];
677
		foreach ( $existing as $ns => $dbkeys ) {
678
			if ( isset( $this->mLinks[$ns] ) ) {
679
				$del[$ns] = array_diff_key( $existing[$ns], $this->mLinks[$ns] );
680
			} else {
681
				$del[$ns] = $existing[$ns];
682
			}
683
		}
684
685
		return $del;
686
	}
687
688
	/**
689
	 * Given an array of existing templates, returns those templates which are not in $this
@@ 694-705 (lines=12) @@
691
	 * @param array $existing
692
	 * @return array
693
	 */
694
	private function getTemplateDeletions( $existing ) {
695
		$del = [];
696
		foreach ( $existing as $ns => $dbkeys ) {
697
			if ( isset( $this->mTemplates[$ns] ) ) {
698
				$del[$ns] = array_diff_key( $existing[$ns], $this->mTemplates[$ns] );
699
			} else {
700
				$del[$ns] = $existing[$ns];
701
			}
702
		}
703
704
		return $del;
705
	}
706
707
	/**
708
	 * Given an array of existing images, returns those images which are not in $this
@@ 762-773 (lines=12) @@
759
	 * @param array $existing
760
	 * @return array
761
	 */
762
	private function getInterwikiDeletions( $existing ) {
763
		$del = [];
764
		foreach ( $existing as $prefix => $dbkeys ) {
765
			if ( isset( $this->mInterwikis[$prefix] ) ) {
766
				$del[$prefix] = array_diff_key( $existing[$prefix], $this->mInterwikis[$prefix] );
767
			} else {
768
				$del[$prefix] = $existing[$prefix];
769
			}
770
		}
771
772
		return $del;
773
	}
774
775
	/**
776
	 * Get an array of existing links, as a 2-D array