Code Duplication    Length = 3-3 lines in 2 locations

includes/abstracts/abstract-wc-rest-terms-controller.php 2 locations

@@ 417-419 (lines=3) @@
414
		$response->set_status( 201 );
415
416
		$base = '/' . $this->namespace . '/' . $this->rest_base;
417
		if ( ! empty( $request['attribute_id'] ) ) {
418
			$base = str_replace( '(?P<attribute_id>[\d]+)', (int) $request['attribute_id'], $base );
419
		}
420
421
		$response->header( 'Location', rest_url( $base . '/' . $term->term_id ) );
422
@@ 559-561 (lines=3) @@
556
	protected function prepare_links( $term, $request ) {
557
		$base = '/' . $this->namespace . '/' . $this->rest_base;
558
559
		if ( ! empty( $request['attribute_id'] ) ) {
560
			$base = str_replace( '(?P<attribute_id>[\d]+)', (int) $request['attribute_id'], $base );
561
		}
562
563
		$links = array(
564
			'self' => array(