Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 205-213 (lines=9) @@
202
	 * @param  array $package
203
	 * @return int
204
	 */
205
	public function get_package_item_qty( $package ) {
206
		$total_quantity = 0;
207
		foreach ( $package['contents'] as $item_id => $values ) {
208
			if ( $values['quantity'] > 0 && $values['data']->needs_shipping() ) {
209
				$total_quantity += $values['quantity'];
210
			}
211
		}
212
		return $total_quantity;
213
	}
214
215
	/**
216
	 * Finds and returns shipping classes and the products with said class.

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

@@ 223-231 (lines=9) @@
220
	 * @param  array $package
221
	 * @return int
222
	 */
223
	public function get_package_item_qty( $package ) {
224
		$total_quantity = 0;
225
		foreach ( $package['contents'] as $item_id => $values ) {
226
			if ( $values['quantity'] > 0 && $values['data']->needs_shipping() ) {
227
				$total_quantity += $values['quantity'];
228
			}
229
		}
230
		return $total_quantity;
231
	}
232
233
	/**
234
	 * Finds and returns shipping classes and the products with said class.