Code Duplication    Length = 9-9 lines in 2 locations

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.

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

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