Code Duplication    Length = 3-10 lines in 3 locations

_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php 2 locations

@@ 461-463 (lines=3) @@
458
		}
459
460
		// Exit if no parameters were passed.
461
		if ( ! is_array( $params ) ) {
462
			return new WP_Error( 'missing_options', esc_html__( 'Missing options.', 'jetpack' ), array( 'status' => 404 ) );
463
		}
464
465
		// If $params was set via `get_body_params()` there may be some additional variables in the request that can
466
		// cause validation to fail. This method verifies that each param was in fact updated and will throw a `some_updated`
@@ 1206-1215 (lines=10) @@
1203
		}
1204
1205
		$verification_services_codes = get_option( 'verification_services_codes' );
1206
		if (
1207
			! is_array( $verification_services_codes )
1208
			|| empty( $verification_services_codes )
1209
		) {
1210
			return new WP_Error(
1211
				'empty',
1212
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
1213
				array( 'status' => 404 )
1214
			);
1215
		}
1216
1217
		$services = array();
1218
		foreach ( jetpack_verification_services() as $name => $service ) {

_inc/lib/class.core-rest-api-endpoints.php 1 location

@@ 623-625 (lines=3) @@
620
		$param = $request->get_params();
621
622
		// Exit if no parameters were passed.
623
		if ( ! is_array( $param ) ) {
624
			return new WP_Error( 'missing_setting', esc_html__( 'Missing setting.', 'jetpack' ), array( 'status' => 404 ) );
625
		}
626
627
		// Get option name and value.
628
		$option = key( $param );