Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 3039-3043 (lines=5) @@
3036
				$options = self::split_options( $options, $sharer->get_global_options() );
3037
				$options['sharing_services']['current_value'] = $sharer->get_blog_services();
3038
				$other_sharedaddy_options = array( 'jetpack-twitter-cards-site-tag', 'sharedaddy_disable_resources', 'sharing_delete_service' );
3039
				foreach ( $other_sharedaddy_options as $key ) {
3040
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
3041
					$current_value = get_option( $key, $default_value );
3042
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
3043
				}
3044
				break;
3045
3046
			case 'stats':
@@ 3055-3059 (lines=5) @@
3052
				break;
3053
			default:
3054
				// These option are just stored as plain WordPress options.
3055
				foreach ( $options as $key => $value ) {
3056
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
3057
					$current_value = get_option( $key, $default_value );
3058
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
3059
				}
3060
		}
3061
		// At this point some options have current_value not set because they're options
3062
		// that only get written on update, so we set current_value to the default one.