Code Duplication    Length = 9-11 lines in 2 locations

core/helpers/EEH_Line_Item.helper.php 2 locations

@@ 411-421 (lines=11) @@
408
    public static function cancel_ticket_line_item(EE_Line_Item $ticket_line_item, $qty = 1)
409
    {
410
        // validate incoming line_item
411
        if ($ticket_line_item->OBJ_type() !== EEM_Line_Item::OBJ_TYPE_TICKET) {
412
            throw new EE_Error(
413
                sprintf(
414
                    esc_html__(
415
                        'The supplied line item must have an Object Type of "Ticket", not %1$s.',
416
                        'event_espresso'
417
                    ),
418
                    $ticket_line_item->type()
419
                )
420
            );
421
        }
422
        if ($ticket_line_item->quantity() < $qty) {
423
            throw new EE_Error(
424
                sprintf(
@@ 509-517 (lines=9) @@
506
    public static function reinstate_canceled_ticket_line_item(EE_Line_Item $ticket_line_item, $qty = 1)
507
    {
508
        // validate incoming line_item
509
        if ($ticket_line_item->OBJ_type() !== EEM_Line_Item::OBJ_TYPE_TICKET) {
510
            throw new EE_Error(
511
                sprintf(
512
                    esc_html__(
513
                        'The supplied line item must have an Object Type of "Ticket", not %1$s.',
514
                        'event_espresso'
515
                    ),
516
                    $ticket_line_item->type()
517
                )
518
            );
519
        }
520
        // get cancellation sub line item