Code Duplication    Length = 5-7 lines in 2 locations

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

@@ 30-34 (lines=5) @@
27
28
function add_query_arg( ...$args ) {
29
	if ( is_array( $args[0] ) ) {
30
		if ( count( $args ) < 2 || false === $args[1] ) {
31
			$uri = $_SERVER['REQUEST_URI'];
32
		} else {
33
			$uri = $args[1];
34
		}
35
	} else {
36
		if ( count( $args ) < 3 || false === $args[2] ) {
37
			$uri = $_SERVER['REQUEST_URI'];
@@ 35-41 (lines=7) @@
32
		} else {
33
			$uri = $args[1];
34
		}
35
	} else {
36
		if ( count( $args ) < 3 || false === $args[2] ) {
37
			$uri = $_SERVER['REQUEST_URI'];
38
		} else {
39
			$uri = $args[2];
40
		}
41
	}
42
43
	$frag = strstr( $uri, '#' );
44
	if ( $frag ) {