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

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