Code Duplication    Length = 9-11 lines in 2 locations

core/db_classes/EE_Ticket.class.php 2 locations

@@ 855-865 (lines=11) @@
852
     * @throws InvalidInterfaceException
853
     * @throws ReflectionException
854
     */
855
    protected function decreaseSoldForDatetimes($qty = 1, array $datetimes = [])
856
    {
857
        $datetimes = ! empty($datetimes) ? $datetimes : $this->datetimes();
858
        if (is_array($datetimes)) {
859
            foreach ($datetimes as $datetime) {
860
                if ($datetime instanceof EE_Datetime) {
861
                    $datetime->decreaseSold($qty);
862
                }
863
            }
864
        }
865
    }
866
867
868
    /**
@@ 1033-1041 (lines=9) @@
1030
     * @throws InvalidDataTypeException
1031
     * @throws InvalidInterfaceException
1032
     */
1033
    protected function decreaseReservedForDatetimes($qty = 1, array $datetimes = [])
1034
    {
1035
        $datetimes = ! empty($datetimes) ? $datetimes : $this->datetimes();
1036
        foreach ($datetimes as $datetime) {
1037
            if ($datetime instanceof EE_Datetime) {
1038
                $datetime->decreaseReserved($qty);
1039
            }
1040
        }
1041
    }
1042
1043
1044
    /**