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

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