Code Duplication    Length = 5-7 lines in 2 locations

packages/redirect/tests/php/bootstrap.php 2 locations

@@ 38-42 (lines=5) @@
35
36
function add_query_arg( ...$args ) {
37
	if ( is_array( $args[0] ) ) {
38
		if ( count( $args ) < 2 || false === $args[1] ) {
39
			$uri = $_SERVER['REQUEST_URI'];
40
		} else {
41
			$uri = $args[1];
42
		}
43
	} else {
44
		if ( count( $args ) < 3 || false === $args[2] ) {
45
			$uri = $_SERVER['REQUEST_URI'];
@@ 43-49 (lines=7) @@
40
		} else {
41
			$uri = $args[1];
42
		}
43
	} else {
44
		if ( count( $args ) < 3 || false === $args[2] ) {
45
			$uri = $_SERVER['REQUEST_URI'];
46
		} else {
47
			$uri = $args[2];
48
		}
49
	}
50
51
	$frag = strstr( $uri, '#' );
52
	if ( $frag ) {