Code Duplication    Length = 8-10 lines in 2 locations

sync/class.jetpack-sync-json-deflate-array-codec.php 1 location

@@ 41-48 (lines=8) @@
38
39
		if ( is_array( $any ) ) {
40
			foreach ( $any as $k => $v ) {
41
				if ( ( is_array( $v ) || is_object( $v ) ) ) {
42
					if ( in_array( $v, $seen_nodes, true ) ) {
43
						unset( $any[ $k ] );
44
						continue;
45
					} else {
46
						$seen_nodes[] = &$v;		
47
					}
48
				}				
49
				$any[ $k ] = $this->json_wrap( $v, $seen_nodes );
50
			}
51
		}

sync/class.jetpack-sync-json-deflate-codec.php 1 location

@@ 43-52 (lines=10) @@
40
		if ( is_array( $any ) || is_object( $any ) ) {
41
			foreach ( $any as $k => &$v ) {
42
				if ( ( is_array( $v ) || is_object( $v ) ) ) {
43
					if ( in_array( $v, $seen_nodes, true ) ) {
44
						if ( is_object( $any ) ) {
45
							unset( $any->{ $k } );	
46
						} else {
47
							unset( $any[ $k ] );
48
						}
49
						continue;
50
					} else {
51
						$seen_nodes[] = $v;
52
					}
53
				}
54
				$v = $this->json_wrap( $v, false, $seen_nodes );
55
			}