Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 342-355 (lines=14) @@
339
					}
340
				}
341
				break;
342
			case 'post_thumbnail' :
343
				$response[$key] = null;
344
345
				$thumb_id = get_post_thumbnail_id( $post->ID );
346
				if ( ! empty( $thumb_id ) ) {
347
					$attachment = get_post( $thumb_id );
348
					if ( ! empty( $attachment ) )
349
						$featured_image_object = $this->get_attachment( $attachment );
350
351
					if ( ! empty( $featured_image_object ) ) {
352
						$response[$key] = (object) $featured_image_object;
353
					}
354
				}
355
				break;
356
			case 'format' :
357
				$response[$key] = (string) get_post_format( $post->ID );
358
				if ( !$response[$key] ) {

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

@@ 326-339 (lines=14) @@
323
					}
324
				}
325
				break;
326
			case 'post_thumbnail' :
327
				$response[$key] = null;
328
329
				$thumb_id = get_post_thumbnail_id( $post->ID );
330
				if ( ! empty( $thumb_id ) ) {
331
					$attachment = get_post( $thumb_id );
332
					if ( ! empty( $attachment ) )
333
						$featured_image_object = $this->get_attachment( $attachment );
334
335
					if ( ! empty( $featured_image_object ) ) {
336
						$response[$key] = (object) $featured_image_object;
337
					}
338
				}
339
				break;
340
			case 'format' :
341
				$response[$key] = (string) get_post_format( $post->ID );
342
				if ( !$response[$key] ) {