Code Duplication    Length = 7-8 lines in 4 locations

includes/user/User.php 4 locations

@@ 4989-4996 (lines=8) @@
4986
			'remove-self' => []
4987
		];
4988
4989
		if ( empty( $wgAddGroups[$group] ) ) {
4990
			// Don't add anything to $groups
4991
		} elseif ( $wgAddGroups[$group] === true ) {
4992
			// You get everything
4993
			$groups['add'] = self::getAllGroups();
4994
		} elseif ( is_array( $wgAddGroups[$group] ) ) {
4995
			$groups['add'] = $wgAddGroups[$group];
4996
		}
4997
4998
		// Same thing for remove
4999
		if ( empty( $wgRemoveGroups[$group] ) ) {
@@ 4999-5005 (lines=7) @@
4996
		}
4997
4998
		// Same thing for remove
4999
		if ( empty( $wgRemoveGroups[$group] ) ) {
5000
			// Do nothing
5001
		} elseif ( $wgRemoveGroups[$group] === true ) {
5002
			$groups['remove'] = self::getAllGroups();
5003
		} elseif ( is_array( $wgRemoveGroups[$group] ) ) {
5004
			$groups['remove'] = $wgRemoveGroups[$group];
5005
		}
5006
5007
		// Re-map numeric keys of AddToSelf/RemoveFromSelf to the 'user' key for backwards compatibility
5008
		if ( empty( $wgGroupsAddToSelf['user'] ) || $wgGroupsAddToSelf['user'] !== true ) {
@@ 5025-5032 (lines=8) @@
5022
		}
5023
5024
		// Now figure out what groups the user can add to him/herself
5025
		if ( empty( $wgGroupsAddToSelf[$group] ) ) {
5026
			// Do nothing
5027
		} elseif ( $wgGroupsAddToSelf[$group] === true ) {
5028
			// No idea WHY this would be used, but it's there
5029
			$groups['add-self'] = User::getAllGroups();
5030
		} elseif ( is_array( $wgGroupsAddToSelf[$group] ) ) {
5031
			$groups['add-self'] = $wgGroupsAddToSelf[$group];
5032
		}
5033
5034
		if ( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
5035
			// Do nothing
@@ 5034-5040 (lines=7) @@
5031
			$groups['add-self'] = $wgGroupsAddToSelf[$group];
5032
		}
5033
5034
		if ( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
5035
			// Do nothing
5036
		} elseif ( $wgGroupsRemoveFromSelf[$group] === true ) {
5037
			$groups['remove-self'] = User::getAllGroups();
5038
		} elseif ( is_array( $wgGroupsRemoveFromSelf[$group] ) ) {
5039
			$groups['remove-self'] = $wgGroupsRemoveFromSelf[$group];
5040
		}
5041
5042
		return $groups;
5043
	}