Code Duplication    Length = 15-16 lines in 2 locations

class.jetpack.php 1 location

@@ 5840-5854 (lines=15) @@
5837
		if ( ! empty( $args[0] ) ) {
5838
			call_user_func_array( array( $clients[ $client_blog_id ], 'addCall' ), $args );
5839
		} elseif ( is_multisite() ) {
5840
			foreach ( $clients as $client_blog_id => $client ) {
5841
				if ( ! $client_blog_id || empty( $client->calls ) ) {
5842
					continue;
5843
				}
5844
5845
				$switch_success = switch_to_blog( $client_blog_id, true );
5846
				if ( ! $switch_success ) {
5847
					continue;
5848
				}
5849
5850
				flush();
5851
				$client->query();
5852
5853
				restore_current_blog();
5854
			}
5855
		} else {
5856
			if ( isset( $clients[0] ) && ! empty( $clients[0]->calls ) ) {
5857
				flush();

packages/connection/src/class-xmlrpc-async-call.php 1 location

@@ 100-115 (lines=16) @@
97
				continue;
98
			}
99
100
			foreach ( $blog_clients as $client ) {
101
				if ( empty( $client->calls ) ) {
102
					continue;
103
				}
104
105
				$switch_success = switch_to_blog( $client_blog_id, true );
106
107
				if ( ! $switch_success ) {
108
					continue;
109
				}
110
111
				flush();
112
				$client->query();
113
114
				restore_current_blog();
115
			}
116
		}
117
	}
118