Code Duplication    Length = 5-5 lines in 2 locations

includes/api/class-wc-rest-orders-controller.php 1 location

@@ 357-361 (lines=5) @@
354
			);
355
		}
356
357
		if ( 0 !== (int) $order->post->post_parent ) {
358
			$links['up'] = array(
359
				'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $order->post->post_parent ) ),
360
			);
361
		}
362
363
		return $links;
364
	}

includes/api/class-wc-rest-products-controller.php 1 location

@@ 564-568 (lines=5) @@
561
			$links['up'] = array(
562
				'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->parent ) ),
563
			);
564
		} elseif ( $product->is_type( 'simple' ) && ! empty( $product->post->post_parent ) ) {
565
			$links['up'] = array(
566
				'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->post->post_parent ) ),
567
			);
568
		}
569
570
		return $links;
571
	}