Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 3090-3094 (lines=5) @@
3087
				$options = self::split_options( $options, $sharer->get_global_options() );
3088
				$options['sharing_services']['current_value'] = $sharer->get_blog_services();
3089
				$other_sharedaddy_options = array( 'jetpack-twitter-cards-site-tag', 'sharedaddy_disable_resources', 'sharing_delete_service' );
3090
				foreach ( $other_sharedaddy_options as $key ) {
3091
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
3092
					$current_value = get_option( $key, $default_value );
3093
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
3094
				}
3095
				break;
3096
3097
			case 'stats':
@@ 3106-3110 (lines=5) @@
3103
				break;
3104
			default:
3105
				// These option are just stored as plain WordPress options.
3106
				foreach ( $options as $key => $value ) {
3107
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
3108
					$current_value = get_option( $key, $default_value );
3109
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
3110
				}
3111
		}
3112
		// At this point some options have current_value not set because they're options
3113
		// that only get written on update, so we set current_value to the default one.