Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 207-215 (lines=9) @@
204
	 * @param  array $package
205
	 * @return int
206
	 */
207
	public function get_package_item_qty( $package ) {
208
		$total_quantity = 0;
209
		foreach ( $package['contents'] as $item_id => $values ) {
210
			if ( $values['quantity'] > 0 && $values['data']->needs_shipping() ) {
211
				$total_quantity += $values['quantity'];
212
			}
213
		}
214
		return $total_quantity;
215
	}
216
217
	/**
218
	 * 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

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