Code Duplication    Length = 10-11 lines in 2 locations

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

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