Code Duplication    Length = 18-18 lines in 2 locations

includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php 1 location

@@ 117-134 (lines=18) @@
114
	 * @param  array $atts
115
	 * @return string
116
	 */
117
	public function fee( $atts ) {
118
		$atts = shortcode_atts( array(
119
			'percent' => '',
120
			'min_fee' => ''
121
		), $atts );
122
123
		$calculated_fee = 0;
124
125
		if ( $atts['percent'] ) {
126
			$calculated_fee = $this->fee_cost * ( floatval( $atts['percent'] ) / 100 );
127
		}
128
129
		if ( $atts['min_fee'] && $calculated_fee < $atts['min_fee'] ) {
130
			$calculated_fee = $atts['min_fee'];
131
		}
132
133
		return $calculated_fee;
134
	}
135
136
	/**
137
	 * calculate_shipping function.

includes/shipping/flat-rate/class-wc-shipping-flat-rate.php 1 location

@@ 100-117 (lines=18) @@
97
	 * @param  array $atts
98
	 * @return string
99
	 */
100
	public function fee( $atts ) {
101
		$atts = shortcode_atts( array(
102
			'percent' => '',
103
			'min_fee' => ''
104
		), $atts );
105
106
		$calculated_fee = 0;
107
108
		if ( $atts['percent'] ) {
109
			$calculated_fee = $this->fee_cost * ( floatval( $atts['percent'] ) / 100 );
110
		}
111
112
		if ( $atts['min_fee'] && $calculated_fee < $atts['min_fee'] ) {
113
			$calculated_fee = $atts['min_fee'];
114
		}
115
116
		return $calculated_fee;
117
	}
118
119
	/**
120
	 * calculate_shipping function.