Code Duplication    Length = 10-12 lines in 3 locations

src/Sylius/Component/Order/Model/OrderItem.php 1 location

@@ 161-172 (lines=12) @@
158
    /**
159
     * {@inheritdoc}
160
     */
161
    public function recalculateAdjustmentsTotal()
162
    {
163
        $this->adjustmentsTotal = 0;
164
165
        foreach ($this->adjustments as $adjustment) {
166
            if (!$adjustment->isNeutral()) {
167
                $this->adjustmentsTotal += $adjustment->getAmount();
168
            }
169
        }
170
171
        $this->recalculateTotal();
172
    }
173
174
    /**
175
     * {@inheritdoc}

src/Sylius/Component/Order/Model/OrderItemUnit.php 1 location

@@ 167-176 (lines=10) @@
164
    /**
165
     * {@inheritdoc}
166
     */
167
    public function recalculateAdjustmentsTotal()
168
    {
169
        $this->adjustmentsTotal = 0;
170
171
        foreach ($this->adjustments as $adjustment) {
172
            if (!$adjustment->isNeutral()) {
173
                $this->adjustmentsTotal += $adjustment->getAmount();
174
            }
175
        }
176
    }
177
178
    /**
179
     * @param AdjustmentInterface $adjustment

src/Sylius/Component/Order/Model/Order.php 1 location

@@ 497-508 (lines=12) @@
494
    /**
495
     * {@inheritdoc}
496
     */
497
    public function recalculateAdjustmentsTotal()
498
    {
499
        $this->adjustmentsTotal = 0;
500
501
        foreach ($this->adjustments as $adjustment) {
502
            if (!$adjustment->isNeutral()) {
503
                $this->adjustmentsTotal += $adjustment->getAmount();
504
            }
505
        }
506
507
        $this->recalculateTotal();
508
    }
509
510
    /**
511
     * Calculate total.