Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 2784-2788 (lines=5) @@
2781
				$options = self::split_options( $options, $sharer->get_global_options() );
2782
				$options['sharing_services']['current_value'] = $sharer->get_blog_services();
2783
				$other_sharedaddy_options = array( 'jetpack-twitter-cards-site-tag', 'sharedaddy_disable_resources', 'sharing_delete_service' );
2784
				foreach ( $other_sharedaddy_options as $key ) {
2785
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
2786
					$current_value = get_option( $key, $default_value );
2787
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
2788
				}
2789
				break;
2790
2791
			case 'stats':
@@ 2800-2804 (lines=5) @@
2797
				break;
2798
			default:
2799
				// These option are just stored as plain WordPress options.
2800
				foreach ( $options as $key => $value ) {
2801
					$default_value = isset( $options[ $key ]['default'] ) ? $options[ $key ]['default'] : '';
2802
					$current_value = get_option( $key, $default_value );
2803
					$options[ $key ]['current_value'] = self::cast_value( $current_value, $options[ $key ] );
2804
				}
2805
		}
2806
		// At this point some options have current_value not set because they're options
2807
		// that only get written on update, so we set current_value to the default one.