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

@@ 1395-1404 (lines=10) @@
1392
			'Ticket',
1393
			array($ticket->ID())
1394
		);
1395
		foreach ($ticket_line_items as $ticket_line_item) {
1396
			if (
1397
				$ticket_line_item instanceof \EE_Line_Item
1398
				&& $ticket_line_item->OBJ_type() === 'Ticket'
1399
				&& $ticket_line_item->OBJ_ID() === $ticket->ID()
1400
			) {
1401
				$line_item = $ticket_line_item;
1402
				break;
1403
			}
1404
		}
1405
		if ( ! ($line_item instanceof \EE_Line_Item && $line_item->OBJ_type() === 'Ticket')) {
1406
			throw new EntityNotFoundException('Line Item Ticket ID', $ticket->ID());
1407
		}