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
@@ 560-562 (lines=3) @@
557
	protected function prepare_links( $term, $request ) {
558
		$base = '/' . $this->namespace . '/' . $this->rest_base;
559
560
		if ( ! empty( $request['attribute_id'] ) ) {
561
			$base = str_replace( '(?P<attribute_id>[\d]+)', (int) $request['attribute_id'], $base );
562
		}
563
564
		$links = array(
565
			'self' => array(