Code Duplication    Length = 10-11 lines in 2 locations

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

@@ 437-446 (lines=10) @@
434
435
		// Return non existant post.
436
		$post_type = get_post_type_object( $post->post_type );
437
		if ( empty( $post_type ) || ! is_object( $post_type ) ) {
438
			$non_existant_post                    = new \stdClass();
439
			$non_existant_post->ID                = $post->ID;
440
			$non_existant_post->post_modified     = $post->post_modified;
441
			$non_existant_post->post_modified_gmt = $post->post_modified_gmt;
442
			$non_existant_post->post_status       = 'jetpack_sync_non_registered_post_type';
443
			$non_existant_post->post_type         = $post->post_type;
444
445
			return $non_existant_post;
446
		}
447
		/**
448
		 * Filters whether to prevent sending post data to .com
449
		 *
@@ 461-471 (lines=11) @@
458
		 * @param boolean false prevent post data from being synced to WordPress.com
459
		 * @param mixed $post \WP_Post object
460
		 */
461
		if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) {
462
			// We only send the bare necessary object to be able to create a checksum.
463
			$blocked_post                    = new \stdClass();
464
			$blocked_post->ID                = $post->ID;
465
			$blocked_post->post_modified     = $post->post_modified;
466
			$blocked_post->post_modified_gmt = $post->post_modified_gmt;
467
			$blocked_post->post_status       = 'jetpack_sync_blocked';
468
			$blocked_post->post_type         = $post->post_type;
469
470
			return $blocked_post;
471
		}
472
473
		// lets not do oembed just yet.
474
		$this->remove_embed();