Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 3083-3087 (lines=5) @@
3080
				$options = self::split_options( $options, $sharer->get_global_options() );
3081
				$options['sharing_services']['current_value'] = $sharer->get_blog_services();
3082
				$other_sharedaddy_options = array( 'jetpack-twitter-cards-site-tag', 'sharedaddy_disable_resources', 'sharing_delete_service' );
3083
				foreach ( $other_sharedaddy_options as $key ) {
3084
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
3085
					$current_value = get_option( $key, $default_value );
3086
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
3087
				}
3088
				break;
3089
3090
			case 'stats':
@@ 3099-3103 (lines=5) @@
3096
				break;
3097
			default:
3098
				// These option are just stored as plain WordPress options.
3099
				foreach ( $options as $key => $value ) {
3100
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
3101
					$current_value = get_option( $key, $default_value );
3102
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
3103
				}
3104
		}
3105
		// At this point some options have current_value not set because they're options
3106
		// that only get written on update, so we set current_value to the default one.