Code Duplication    Length = 6-7 lines in 2 locations

core/libraries/line_item_filters/EE_Non_Zero_Line_Item_Filter.class.php 1 location

@@ 77-83 (lines=7) @@
74
	 * @return EEI_Line_Item
75
	 */
76
	protected function _filter_zero_line_item( EEI_Line_Item $line_item ) {
77
		if (
78
			$line_item->type() === EEM_Line_Item::type_line_item &&
79
			$line_item->OBJ_type() === 'Ticket' &&
80
			$line_item->quantity() == 0
81
		) {
82
			return null;
83
		}
84
		return $line_item;
85
	}
86

core/helpers/EEH_Line_Item.helper.php 1 location

@@ 1221-1226 (lines=6) @@
1218
	 * @return EE_Line_Item
1219
	 */
1220
	public static function non_empty_line_item( EE_Line_Item $line_item ) {
1221
		if ( $line_item->type() === EEM_Line_Item::type_line_item &&
1222
			$line_item->OBJ_type() === 'Ticket' &&
1223
			$line_item->quantity() == 0
1224
		) {
1225
			return null;
1226
		}
1227
		$new_li_fields = $line_item->model_field_array();
1228
		//don't set the total. We'll leave that up to the code that calculates it
1229
		unset( $new_li_fields[ 'LIN_ID' ] );