Code Duplication    Length = 10-10 lines in 2 locations

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

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

core/db_classes/EE_Registration.class.php 1 location

@@ 1910-1919 (lines=10) @@
1907
            'Ticket',
1908
            array($ticket->ID())
1909
        );
1910
        foreach ($ticket_line_items as $ticket_line_item) {
1911
            if ($ticket_line_item instanceof \EE_Line_Item
1912
                && $ticket_line_item->OBJ_type() === 'Ticket'
1913
                && $ticket_line_item->OBJ_ID() === $ticket->ID()
1914
            ) {
1915
                $line_item = $ticket_line_item;
1916
                break;
1917
            }
1918
        }
1919
        if (! ($line_item instanceof \EE_Line_Item && $line_item->OBJ_type() === 'Ticket')) {
1920
            throw new EntityNotFoundException('Line Item Ticket ID', $ticket->ID());
1921
        }
1922
        return $line_item;