Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 2463-2467 (lines=5) @@
2460
				$options = self::split_options( $options, $sharer->get_global_options() );
2461
				$options['sharing_services']['current_value'] = $sharer->get_blog_services();
2462
				$other_sharedaddy_options = array( 'jetpack-twitter-cards-site-tag', 'sharedaddy_disable_resources', 'sharing_delete_service' );
2463
				foreach ( $other_sharedaddy_options as $key ) {
2464
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
2465
					$current_value = get_option( $key, $default_value );
2466
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
2467
				}
2468
				break;
2469
2470
			case 'after-the-deadline':
@@ 2494-2498 (lines=5) @@
2491
				break;
2492
			default:
2493
				// These option are just stored as plain WordPress options.
2494
				foreach ( $options as $key => $value ) {
2495
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
2496
					$current_value = get_option( $key, $default_value );
2497
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
2498
				}
2499
		}
2500
		// At this point some options have current_value not set because they're options
2501
		// that only get written on update, so we set current_value to the default one.