Code Duplication    Length = 17-17 lines in 2 locations

includes/abstracts/abstract-wc-order.php 1 location

@@ 1191-1207 (lines=17) @@
1188
	 * @param string $item_type
1189
	 * @return string
1190
	 */
1191
	public function get_item_count( $item_type = '' ) {
1192
		if ( empty( $item_type ) ) {
1193
			$item_type = array( 'line_item' );
1194
		}
1195
		if ( ! is_array( $item_type ) ) {
1196
			$item_type = array( $item_type );
1197
		}
1198
1199
		$items = $this->get_items( $item_type );
1200
		$count = 0;
1201
1202
		foreach ( $items as $item ) {
1203
			$count += empty( $item['qty'] ) ? 1 : $item['qty'];
1204
		}
1205
1206
		return apply_filters( 'woocommerce_get_item_count', $count, $item_type, $this );
1207
	}
1208
1209
	/**
1210
	 * Get refunds

includes/class-wc-order.php 1 location

@@ 154-170 (lines=17) @@
151
	 * @param string $item_type
152
	 * @return string
153
	 */
154
	public function get_item_count_refunded( $item_type = '' ) {
155
		if ( empty( $item_type ) ) {
156
			$item_type = array( 'line_item' );
157
		}
158
		if ( ! is_array( $item_type ) ) {
159
			$item_type = array( $item_type );
160
		}
161
		$count = 0;
162
163
		foreach ( $this->get_refunds() as $refund ) {
164
			foreach ( $refund->get_items( $item_type ) as $refunded_item ) {
165
				$count += empty( $refunded_item['qty'] ) ? 0 : $refunded_item['qty'];
166
			}
167
		}
168
169
		return apply_filters( 'woocommerce_get_item_count_refunded', $count, $item_type, $this );
170
	}
171
172
	/**
173
	 * Get the total number of items refunded.