Code Duplication    Length = 5-5 lines in 2 locations

includes/cli/class-wc-cli-tax.php 1 location

@@ 674-678 (lines=5) @@
671
				WHERE tax_rate_id = %d
672
			", $id ) );
673
674
			if ( ! is_wp_error( $tax ) && ! is_null( $tax ) ) {
675
				foreach ( $locales as $locale ) {
676
					$tax_data[ $locale->location_type ] = $locale->location_code;
677
				}
678
			}
679
680
			$items[] = $tax_data;
681
		}

includes/api/class-wc-rest-taxes-controller.php 1 location

@@ 487-491 (lines=5) @@
484
			WHERE tax_rate_id = %d
485
		", $id ) );
486
487
		if ( ! is_wp_error( $tax ) && ! is_null( $tax ) ) {
488
			foreach ( $locales as $locale ) {
489
				$data[ $locale->location_type ] = $locale->location_code;
490
			}
491
		}
492
493
		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
494
		$data    = $this->add_additional_fields_to_object( $data, $request );