Code Duplication    Length = 5-5 lines in 2 locations

includes/class-wc-product-variation.php 2 locations

@@ 136-140 (lines=5) @@
133
		$attributes = $this->get_attributes();
134
		$attribute  = sanitize_title( $attribute );
135
136
		if ( isset( $attributes[ $attribute ] ) ) {
137
			$value = $attributes[ $attribute ];
138
			$term  = taxonomy_exists( $attribute ) ? get_term_by( 'slug', $value, $attribute ) : false;
139
			return ! is_wp_error( $term ) && $term ? $term->name : $value;
140
		}
141
142
		$att_str = 'pa_' . $attribute;
143
		if ( isset( $attributes[ $att_str ] ) ) {
@@ 143-147 (lines=5) @@
140
		}
141
142
		$att_str = 'pa_' . $attribute;
143
		if ( isset( $attributes[ $att_str ] ) ) {
144
			$value = $attributes[ $att_str ];
145
			$term  = taxonomy_exists( $att_str ) ? get_term_by( 'slug', $value, $att_str ) : false;
146
			return ! is_wp_error( $term ) && $term ? $term->name : $value;
147
		}
148
149
		return '';
150
	}