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`
@@ 1372-1381 (lines=10) @@
1369
		}
1370
1371
		$verification_services_codes = get_option( 'verification_services_codes' );
1372
		if (
1373
			! is_array( $verification_services_codes )
1374
			|| empty( $verification_services_codes )
1375
		) {
1376
			return new WP_Error(
1377
				'empty',
1378
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
1379
				array( 'status' => 404 )
1380
			);
1381
		}
1382
1383
		$services = array();
1384
		foreach ( jetpack_verification_services() as $name => $service ) {

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

@@ 800-802 (lines=3) @@
797
		$param = $request->get_params();
798
799
		// Exit if no parameters were passed.
800
		if ( ! is_array( $param ) ) {
801
			return new WP_Error( 'missing_setting', esc_html__( 'Missing setting.', 'jetpack' ), array( 'status' => 404 ) );
802
		}
803
804
		// Get option name and value.
805
		$option = key( $param );