Code Duplication    Length = 10-11 lines in 2 locations

packages/sync/src/modules/Posts.php 2 locations

@@ 366-375 (lines=10) @@
363
364
		// Return non existant post.
365
		$post_type = get_post_type_object( $post->post_type );
366
		if ( empty( $post_type ) || ! is_object( $post_type ) ) {
367
			$non_existant_post                    = new \stdClass();
368
			$non_existant_post->ID                = $post->ID;
369
			$non_existant_post->post_modified     = $post->post_modified;
370
			$non_existant_post->post_modified_gmt = $post->post_modified_gmt;
371
			$non_existant_post->post_status       = 'jetpack_sync_non_registered_post_type';
372
			$non_existant_post->post_type         = $post->post_type;
373
374
			return $non_existant_post;
375
		}
376
		/**
377
		 * Filters whether to prevent sending post data to .com
378
		 *
@@ 390-400 (lines=11) @@
387
		 * @param boolean false prevent post data from being synced to WordPress.com
388
		 * @param mixed $post \WP_Post object
389
		 */
390
		if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) {
391
			// We only send the bare necessary object to be able to create a checksum.
392
			$blocked_post                    = new \stdClass();
393
			$blocked_post->ID                = $post->ID;
394
			$blocked_post->post_modified     = $post->post_modified;
395
			$blocked_post->post_modified_gmt = $post->post_modified_gmt;
396
			$blocked_post->post_status       = 'jetpack_sync_blocked';
397
			$blocked_post->post_type         = $post->post_type;
398
399
			return $blocked_post;
400
		}
401
402
		// lets not do oembed just yet.
403
		$this->remove_embed();