Code Duplication    Length = 10-10 lines in 2 locations

core/domain/services/ticket/CancelTicketLineItemService.php 1 location

@@ 123-132 (lines=10) @@
120
            'Ticket',
121
            array($ticket->ID())
122
        );
123
        foreach ($ticket_line_items as $ticket_line_item) {
124
            if (
125
                $ticket_line_item instanceof \EE_Line_Item
126
                && $ticket_line_item->OBJ_type() === 'Ticket'
127
                && $ticket_line_item->OBJ_ID() === $ticket->ID()
128
            ) {
129
                $line_item = $ticket_line_item;
130
                break;
131
            }
132
        }
133
        if ( ! ($line_item instanceof \EE_Line_Item && $line_item->OBJ_type() === 'Ticket')) {
134
            throw new EntityNotFoundException('Line Item Ticket ID', $ticket->ID());
135
        }

core/db_classes/EE_Registration.class.php 1 location

@@ 1501-1510 (lines=10) @@
1498
			'Ticket',
1499
			array($ticket->ID())
1500
		);
1501
		foreach ($ticket_line_items as $ticket_line_item) {
1502
			if (
1503
				$ticket_line_item instanceof \EE_Line_Item
1504
				&& $ticket_line_item->OBJ_type() === 'Ticket'
1505
				&& $ticket_line_item->OBJ_ID() === $ticket->ID()
1506
			) {
1507
				$line_item = $ticket_line_item;
1508
				break;
1509
			}
1510
		}
1511
		if ( ! ($line_item instanceof \EE_Line_Item && $line_item->OBJ_type() === 'Ticket')) {
1512
			throw new EntityNotFoundException('Line Item Ticket ID', $ticket->ID());
1513
		}