Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 2979-2983 (lines=5) @@
2976
				$options = self::split_options( $options, $sharer->get_global_options() );
2977
				$options['sharing_services']['current_value'] = $sharer->get_blog_services();
2978
				$other_sharedaddy_options = array( 'jetpack-twitter-cards-site-tag', 'sharedaddy_disable_resources', 'sharing_delete_service' );
2979
				foreach ( $other_sharedaddy_options as $key ) {
2980
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
2981
					$current_value = get_option( $key, $default_value );
2982
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
2983
				}
2984
				break;
2985
2986
			case 'stats':
@@ 2995-2999 (lines=5) @@
2992
				break;
2993
			default:
2994
				// These option are just stored as plain WordPress options.
2995
				foreach ( $options as $key => $value ) {
2996
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
2997
					$current_value = get_option( $key, $default_value );
2998
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
2999
				}
3000
		}
3001
		// At this point some options have current_value not set because they're options
3002
		// that only get written on update, so we set current_value to the default one.