Code Duplication    Length = 3-5 lines in 2 locations

includes/abstracts/abstract-wc-product.php 1 location

@@ 339-343 (lines=5) @@
336
		$status = ( 'outofstock' === $status ) ? 'outofstock' : 'instock';
337
338
		// Sanity check
339
		if ( $this->managing_stock() ) {
340
			if ( ! $this->backorders_allowed() && $this->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount' ) ) {
341
				$status = 'outofstock';
342
			}
343
		}
344
345
		if ( update_post_meta( $this->id, '_stock_status', $status ) ) {
346
			$this->stock_status = $status;

includes/class-wc-product-variation.php 1 location

@@ 510-512 (lines=3) @@
507
				$status = 'outofstock';
508
			}
509
		} elseif ( 'parent' === $this->managing_stock() ) {
510
			if ( ! $this->parent->backorders_allowed() && $this->parent->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount' ) ) {
511
				$status = 'outofstock';
512
			}
513
		}
514
515
		if ( update_post_meta( $this->variation_id, '_stock_status', $status ) ) {