Code Duplication    Length = 7-8 lines in 4 locations

includes/user/User.php 4 locations

@@ 4851-4858 (lines=8) @@
4848
			'remove-self' => []
4849
		];
4850
4851
		if ( empty( $wgAddGroups[$group] ) ) {
4852
			// Don't add anything to $groups
4853
		} elseif ( $wgAddGroups[$group] === true ) {
4854
			// You get everything
4855
			$groups['add'] = self::getAllGroups();
4856
		} elseif ( is_array( $wgAddGroups[$group] ) ) {
4857
			$groups['add'] = $wgAddGroups[$group];
4858
		}
4859
4860
		// Same thing for remove
4861
		if ( empty( $wgRemoveGroups[$group] ) ) {
@@ 4861-4867 (lines=7) @@
4858
		}
4859
4860
		// Same thing for remove
4861
		if ( empty( $wgRemoveGroups[$group] ) ) {
4862
			// Do nothing
4863
		} elseif ( $wgRemoveGroups[$group] === true ) {
4864
			$groups['remove'] = self::getAllGroups();
4865
		} elseif ( is_array( $wgRemoveGroups[$group] ) ) {
4866
			$groups['remove'] = $wgRemoveGroups[$group];
4867
		}
4868
4869
		// Re-map numeric keys of AddToSelf/RemoveFromSelf to the 'user' key for backwards compatibility
4870
		if ( empty( $wgGroupsAddToSelf['user'] ) || $wgGroupsAddToSelf['user'] !== true ) {
@@ 4887-4894 (lines=8) @@
4884
		}
4885
4886
		// Now figure out what groups the user can add to him/herself
4887
		if ( empty( $wgGroupsAddToSelf[$group] ) ) {
4888
			// Do nothing
4889
		} elseif ( $wgGroupsAddToSelf[$group] === true ) {
4890
			// No idea WHY this would be used, but it's there
4891
			$groups['add-self'] = User::getAllGroups();
4892
		} elseif ( is_array( $wgGroupsAddToSelf[$group] ) ) {
4893
			$groups['add-self'] = $wgGroupsAddToSelf[$group];
4894
		}
4895
4896
		if ( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
4897
			// Do nothing
@@ 4896-4902 (lines=7) @@
4893
			$groups['add-self'] = $wgGroupsAddToSelf[$group];
4894
		}
4895
4896
		if ( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
4897
			// Do nothing
4898
		} elseif ( $wgGroupsRemoveFromSelf[$group] === true ) {
4899
			$groups['remove-self'] = User::getAllGroups();
4900
		} elseif ( is_array( $wgGroupsRemoveFromSelf[$group] ) ) {
4901
			$groups['remove-self'] = $wgGroupsRemoveFromSelf[$group];
4902
		}
4903
4904
		return $groups;
4905
	}