Code Duplication    Length = 5-5 lines in 2 locations

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

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