Code Duplication    Length = 3-7 lines in 3 locations

class.jetpack-network.php 1 location

@@ 534-537 (lines=4) @@
531
			$json = false;
532
		}
533
534
		if ( empty( $json->jetpack_secret ) || ! is_string( $json->jetpack_secret ) ) {
535
			restore_current_blog();
536
			return new Jetpack_Error( 'jetpack_secret', '', $code );
537
		}
538
539
		if ( isset( $json->jetpack_public ) ) {
540
			$jetpack_public = (int) $json->jetpack_public;

class.jetpack.php 1 location

@@ 5090-5092 (lines=3) @@
5087
			return new Jetpack_Error( 'unknown_error', __( 'Unknown error registering your Jetpack site', 'jetpack' ), wp_remote_retrieve_response_code( $response ) );
5088
		}
5089
5090
		if ( empty( $registration_details->jetpack_secret ) || ! is_string( $registration_details->jetpack_secret ) ) {
5091
			return new Jetpack_Error( 'jetpack_secret', '', wp_remote_retrieve_response_code( $response ) );
5092
		}
5093
5094
		if ( isset( $registration_details->jetpack_public ) ) {
5095
			$jetpack_public = (int) $registration_details->jetpack_public;

packages/connection/src/Manager.php 1 location

@@ 245-251 (lines=7) @@
242
			);
243
		}
244
245
		if ( empty( $registration_details->jetpack_secret ) || ! is_string( $registration_details->jetpack_secret ) ) {
246
			return new \WP_Error(
247
				'jetpack_secret',
248
				'',
249
				wp_remote_retrieve_response_code( $response )
250
			);
251
		}
252
253
		if ( isset( $registration_details->jetpack_public ) ) {
254
			$jetpack_public = (int) $registration_details->jetpack_public;