Code Duplication    Length = 10-11 lines in 2 locations

packages/sync/src/modules/class-posts.php 2 locations

@@ 375-384 (lines=10) @@
372
373
		// Return non existant post.
374
		$post_type = get_post_type_object( $post->post_type );
375
		if ( empty( $post_type ) || ! is_object( $post_type ) ) {
376
			$non_existant_post                    = new \stdClass();
377
			$non_existant_post->ID                = $post->ID;
378
			$non_existant_post->post_modified     = $post->post_modified;
379
			$non_existant_post->post_modified_gmt = $post->post_modified_gmt;
380
			$non_existant_post->post_status       = 'jetpack_sync_non_registered_post_type';
381
			$non_existant_post->post_type         = $post->post_type;
382
383
			return $non_existant_post;
384
		}
385
		/**
386
		 * Filters whether to prevent sending post data to .com
387
		 *
@@ 399-409 (lines=11) @@
396
		 * @param boolean false prevent post data from being synced to WordPress.com
397
		 * @param mixed $post \WP_Post object
398
		 */
399
		if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) {
400
			// We only send the bare necessary object to be able to create a checksum.
401
			$blocked_post                    = new \stdClass();
402
			$blocked_post->ID                = $post->ID;
403
			$blocked_post->post_modified     = $post->post_modified;
404
			$blocked_post->post_modified_gmt = $post->post_modified_gmt;
405
			$blocked_post->post_status       = 'jetpack_sync_blocked';
406
			$blocked_post->post_type         = $post->post_type;
407
408
			return $blocked_post;
409
		}
410
411
		// lets not do oembed just yet.
412
		$this->remove_embed();