Code Duplication    Length = 10-11 lines in 2 locations

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

@@ 180-189 (lines=10) @@
177
178
		// return non existant post
179
		$post_type = get_post_type_object( $post->post_type );
180
		if ( empty( $post_type ) || ! is_object( $post_type ) ) {
181
			$non_existant_post                    = new \stdClass();
182
			$non_existant_post->ID                = $post->ID;
183
			$non_existant_post->post_modified     = $post->post_modified;
184
			$non_existant_post->post_modified_gmt = $post->post_modified_gmt;
185
			$non_existant_post->post_status       = 'jetpack_sync_non_registered_post_type';
186
			$non_existant_post->post_type         = $post->post_type;
187
188
			return $non_existant_post;
189
		}
190
		/**
191
		 * Filters whether to prevent sending post data to .com
192
		 *
@@ 204-214 (lines=11) @@
201
		 * @param boolean false prevent post data from being synced to WordPress.com
202
		 * @param mixed $post WP_POST object
203
		 */
204
		if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) {
205
			// We only send the bare necessary object to be able to create a checksum.
206
			$blocked_post                    = new \stdClass();
207
			$blocked_post->ID                = $post->ID;
208
			$blocked_post->post_modified     = $post->post_modified;
209
			$blocked_post->post_modified_gmt = $post->post_modified_gmt;
210
			$blocked_post->post_status       = 'jetpack_sync_blocked';
211
			$blocked_post->post_type         = $post->post_type;
212
213
			return $blocked_post;
214
		}
215
216
		// lets not do oembed just yet.
217
		$this->remove_embed();