Code Duplication    Length = 8-10 lines in 2 locations

src/Darryldecode/Cart/Cart.php 2 locations

@@ 591-600 (lines=10) @@
588
        $newTotal = 0.00;
589
        $process = 0;
590
591
        $conditions->each(function (CartCondition $cond) use ($sum, &$newTotal, &$process) {
592
593
            // if this is the first iteration, the toBeCalculated
594
            // should be the sum as initial point of value.
595
            $toBeCalculated = ($process > 0) ? $newTotal : $sum;
596
597
            $newTotal = $cond->applyCondition($toBeCalculated);
598
599
            $process++;
600
        });
601
602
        return Helpers::formatValue(floatval($newTotal), $formatted, $this->config);
603
    }
@@ 630-637 (lines=8) @@
627
        }
628
629
        $conditions
630
            ->each(function (CartCondition $cond) use ($subTotal, &$newTotal, &$process) {
631
                $toBeCalculated = ($process > 0) ? $newTotal : $subTotal;
632
633
                $newTotal = $cond->applyCondition($toBeCalculated);
634
635
                $process++;
636
            });
637
638
        return Helpers::formatValue($newTotal, $this->config['format_numbers'], $this->config);
639
    }
640