Code Duplication    Length = 6-7 lines in 2 locations

core/domain/services/event/EventSpacesCalculator.php 2 locations

@@ 438-443 (lines=6) @@
435
            \EEH_Debug_Tools::printr(__FUNCTION__, __CLASS__, __FILE__, __LINE__, 2);
436
        }
437
        foreach ($this->tickets_sold as $ticket_identifier => $tickets_sold) {
438
            if (isset($this->ticket_quantities[ $ticket_identifier ])){
439
                $this->ticket_quantities[ $ticket_identifier ] -= $tickets_sold;
440
                if ($this->debug) {
441
                    \EEH_Debug_Tools::printr("{$tickets_sold} sales for ticket {$ticket_identifier} ", 'subtracting', __FILE__, __LINE__);
442
                }
443
            }
444
            if (
445
                isset($this->ticket_datetimes[ $ticket_identifier ])
446
                && is_array($this->ticket_datetimes[ $ticket_identifier ])
@@ 449-455 (lines=7) @@
446
                && is_array($this->ticket_datetimes[ $ticket_identifier ])
447
            ){
448
                foreach ($this->ticket_datetimes[ $ticket_identifier ] as $ticket_datetime) {
449
                    if (isset($this->ticket_quantities[ $ticket_identifier ])) {
450
                        $this->datetime_spaces[ $ticket_datetime ] -= $tickets_sold;
451
                        if ($this->debug) {
452
                            \EEH_Debug_Tools::printr("{$tickets_sold} sales for datetime {$ticket_datetime} ",
453
                                'subtracting', __FILE__, __LINE__);
454
                        }
455
                    }
456
                }
457
            }
458
        }