Code Duplication    Length = 7-8 lines in 4 locations

includes/user/User.php 4 locations

@@ 4973-4980 (lines=8) @@
4970
			'remove-self' => []
4971
		];
4972
4973
		if ( empty( $wgAddGroups[$group] ) ) {
4974
			// Don't add anything to $groups
4975
		} elseif ( $wgAddGroups[$group] === true ) {
4976
			// You get everything
4977
			$groups['add'] = self::getAllGroups();
4978
		} elseif ( is_array( $wgAddGroups[$group] ) ) {
4979
			$groups['add'] = $wgAddGroups[$group];
4980
		}
4981
4982
		// Same thing for remove
4983
		if ( empty( $wgRemoveGroups[$group] ) ) {
@@ 4983-4989 (lines=7) @@
4980
		}
4981
4982
		// Same thing for remove
4983
		if ( empty( $wgRemoveGroups[$group] ) ) {
4984
			// Do nothing
4985
		} elseif ( $wgRemoveGroups[$group] === true ) {
4986
			$groups['remove'] = self::getAllGroups();
4987
		} elseif ( is_array( $wgRemoveGroups[$group] ) ) {
4988
			$groups['remove'] = $wgRemoveGroups[$group];
4989
		}
4990
4991
		// Re-map numeric keys of AddToSelf/RemoveFromSelf to the 'user' key for backwards compatibility
4992
		if ( empty( $wgGroupsAddToSelf['user'] ) || $wgGroupsAddToSelf['user'] !== true ) {
@@ 5009-5016 (lines=8) @@
5006
		}
5007
5008
		// Now figure out what groups the user can add to him/herself
5009
		if ( empty( $wgGroupsAddToSelf[$group] ) ) {
5010
			// Do nothing
5011
		} elseif ( $wgGroupsAddToSelf[$group] === true ) {
5012
			// No idea WHY this would be used, but it's there
5013
			$groups['add-self'] = User::getAllGroups();
5014
		} elseif ( is_array( $wgGroupsAddToSelf[$group] ) ) {
5015
			$groups['add-self'] = $wgGroupsAddToSelf[$group];
5016
		}
5017
5018
		if ( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
5019
			// Do nothing
@@ 5018-5024 (lines=7) @@
5015
			$groups['add-self'] = $wgGroupsAddToSelf[$group];
5016
		}
5017
5018
		if ( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
5019
			// Do nothing
5020
		} elseif ( $wgGroupsRemoveFromSelf[$group] === true ) {
5021
			$groups['remove-self'] = User::getAllGroups();
5022
		} elseif ( is_array( $wgGroupsRemoveFromSelf[$group] ) ) {
5023
			$groups['remove-self'] = $wgGroupsRemoveFromSelf[$group];
5024
		}
5025
5026
		return $groups;
5027
	}