Code Duplication    Length = 3-10 lines in 3 locations

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

@@ 485-487 (lines=3) @@
482
		}
483
484
		// Exit if no parameters were passed.
485
		if ( ! is_array( $params ) ) {
486
			return new WP_Error( 'missing_options', esc_html__( 'Missing options.', 'jetpack' ), array( 'status' => 404 ) );
487
		}
488
489
		// If $params was set via `get_body_params()` there may be some additional variables in the request that can
490
		// cause validation to fail. This method verifies that each param was in fact updated and will throw a `some_updated`
@@ 1243-1252 (lines=10) @@
1240
		}
1241
1242
		$verification_services_codes = get_option( 'verification_services_codes' );
1243
		if (
1244
			! is_array( $verification_services_codes )
1245
			|| empty( $verification_services_codes )
1246
		) {
1247
			return new WP_Error(
1248
				'empty',
1249
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
1250
				array( 'status' => 404 )
1251
			);
1252
		}
1253
1254
		$services = array();
1255
		foreach ( jetpack_verification_services() as $name => $service ) {

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

@@ 717-719 (lines=3) @@
714
		$param = $request->get_params();
715
716
		// Exit if no parameters were passed.
717
		if ( ! is_array( $param ) ) {
718
			return new WP_Error( 'missing_setting', esc_html__( 'Missing setting.', 'jetpack' ), array( 'status' => 404 ) );
719
		}
720
721
		// Get option name and value.
722
		$option = key( $param );