Code Duplication    Length = 12-12 lines in 2 locations

json-endpoints/class.wpcom-json-api-post-endpoint.php 1 location

@@ 330-341 (lines=12) @@
327
			case 'global_ID':
328
				$response[$key] = (string) $this->api->add_global_ID( $blog_id, $post->ID );
329
				break;
330
			case 'featured_image' :
331
				if ( $is_jetpack && ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ) {
332
					$response[ $key ] = get_post_meta( $post->ID, '_jetpack_featured_image', true );
333
				} else {
334
					$image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
335
					if ( is_array( $image_attributes ) && isset( $image_attributes[0] ) ) {
336
						$response[ $key ] = (string) $image_attributes[0];
337
					} else {
338
						$response[ $key ] = '';
339
					}
340
				}
341
				break;
342
			case 'post_thumbnail' :
343
				$response[$key] = null;
344

json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php 1 location

@@ 313-324 (lines=12) @@
310
			case 'global_ID':
311
				$response[$key] = (string) $this->api->add_global_ID( $blog_id, $post->ID );
312
				break;
313
			case 'featured_image' :
314
				if ( $is_jetpack && ( defined( 'IS_WPCOM' ) && IS_WPCOM )  ) {
315
					$response[ $key ] = get_post_meta( $post->ID, '_jetpack_featured_image', true );
316
				} else {
317
					$image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
318
					if ( is_array( $image_attributes ) && isset( $image_attributes[0] ) ) {
319
						$response[ $key ] = (string) $image_attributes[0];
320
					} else {
321
						$response[ $key ] = '';
322
					}
323
				}
324
				break;
325
			case 'post_thumbnail' :
326
				$response[$key] = null;
327