Code Duplication    Length = 17-19 lines in 2 locations

includes/data-stores/class-wc-product-data-store-cpt.php 1 location

@@ 122-138 (lines=17) @@
119
			true
120
		);
121
122
		if ( $id && ! is_wp_error( $id ) ) {
123
			$product->set_id( $id );
124
125
			$this->update_post_meta( $product, true );
126
			$this->update_terms( $product, true );
127
			$this->update_visibility( $product, true );
128
			$this->update_attributes( $product, true );
129
			$this->update_version_and_type( $product );
130
			$this->handle_updated_props( $product );
131
132
			$product->save_meta_data();
133
			$product->apply_changes();
134
135
			$this->clear_caches( $product );
136
137
			do_action( 'woocommerce_new_product', $id );
138
		}
139
	}
140
141
	/**

includes/data-stores/class-wc-product-variation-data-store-cpt.php 1 location

@@ 135-153 (lines=19) @@
132
			true
133
		);
134
135
		if ( $id && ! is_wp_error( $id ) ) {
136
			$product->set_id( $id );
137
138
			$this->update_post_meta( $product, true );
139
			$this->update_terms( $product, true );
140
			$this->update_visibility( $product, true );
141
			$this->update_attributes( $product, true );
142
			$this->handle_updated_props( $product );
143
144
			$product->save_meta_data();
145
			$product->apply_changes();
146
147
			$this->update_version_and_type( $product );
148
			$this->update_guid( $product );
149
150
			$this->clear_caches( $product );
151
152
			do_action( 'woocommerce_new_product_variation', $id );
153
		}
154
	}
155
156
	/**