Code Duplication    Length = 5-5 lines in 2 locations

includes/api/class-wc-rest-orders-controller.php 2 locations

@@ 257-261 (lines=5) @@
254
				'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ),
255
			),
256
		);
257
		if ( 0 !== (int) $order->get_user_id() ) {
258
			$links['customer'] = array(
259
				'href' => rest_url( sprintf( '/%s/customers/%d', $this->namespace, $order->get_user_id() ) ),
260
			);
261
		}
262
		if ( 0 !== (int) $order->get_parent_id() ) {
263
			$links['up'] = array(
264
				'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $order->get_parent_id() ) ),
@@ 262-266 (lines=5) @@
259
				'href' => rest_url( sprintf( '/%s/customers/%d', $this->namespace, $order->get_user_id() ) ),
260
			);
261
		}
262
		if ( 0 !== (int) $order->get_parent_id() ) {
263
			$links['up'] = array(
264
				'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $order->get_parent_id() ) ),
265
			);
266
		}
267
		return $links;
268
	}
269