Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 209-215 (lines=7) @@
206
			case 'modified' :
207
				$response[$key] = (string) $this->format_date( $post->post_modified_gmt, $post->post_modified );
208
				break;
209
			case 'title' :
210
				if ( 'display' === $context ) {
211
					$response[$key] = (string) get_the_title( $post->ID );
212
				} else {
213
					$response[$key] = (string) htmlspecialchars_decode( $post->post_title, ENT_QUOTES );
214
				}
215
				break;
216
			case 'URL' :
217
				if ( 'revision' === $post->post_type ) {
218
					$response[$key] = (string) esc_url_raw( get_permalink( $post->post_parent ) );

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

@@ 193-199 (lines=7) @@
190
			case 'modified' :
191
				$response[$key] = (string) $this->format_date( $post->post_modified_gmt, $post->post_modified );
192
				break;
193
			case 'title' :
194
				if ( 'display' === $context ) {
195
					$response[$key] = (string) get_the_title( $post->ID );
196
				} else {
197
					$response[$key] = (string) htmlspecialchars_decode( $post->post_title, ENT_QUOTES );
198
				}
199
				break;
200
			case 'URL' :
201
				if ( 'revision' === $post->post_type ) {
202
					$response[$key] = (string) esc_url_raw( get_permalink( $post->post_parent ) );