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

@@ 1836-1845 (lines=10) @@
1833
            'Ticket',
1834
            array($ticket->ID())
1835
        );
1836
        foreach ($ticket_line_items as $ticket_line_item) {
1837
            if (
1838
                $ticket_line_item instanceof \EE_Line_Item
1839
                && $ticket_line_item->OBJ_type() === 'Ticket'
1840
                && $ticket_line_item->OBJ_ID() === $ticket->ID()
1841
            ) {
1842
                $line_item = $ticket_line_item;
1843
                break;
1844
            }
1845
        }
1846
        if (! ($line_item instanceof \EE_Line_Item && $line_item->OBJ_type() === 'Ticket')) {
1847
            throw new EntityNotFoundException('Line Item Ticket ID', $ticket->ID());
1848
        }