Code Duplication    Length = 15-15 lines in 3 locations

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

@@ 322-336 (lines=15) @@
319
    /**
320
     * {@inheritdoc}
321
     */
322
    public function getAdjustmentsTotal($type = null)
323
    {
324
        if (null === $type) {
325
            return $this->adjustmentsTotal;
326
        }
327
328
        $total = 0;
329
        foreach ($this->getAdjustments($type) as $adjustment) {
330
            if (!$adjustment->isNeutral()) {
331
                $total += $adjustment->getAmount();
332
            }
333
        }
334
335
        return $total;
336
    }
337
338
    /**
339
     * {@inheritdoc}

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

@@ 138-152 (lines=15) @@
135
    /**
136
     * {@inheritdoc}
137
     */
138
    public function getAdjustmentsTotal($type = null)
139
    {
140
        if (null === $type) {
141
            return $this->adjustmentsTotal;
142
        }
143
144
        $total = 0;
145
        foreach ($this->getAdjustments($type) as $adjustment) {
146
            if (!$adjustment->isNeutral()) {
147
                $total += $adjustment->getAmount();
148
            }
149
        }
150
151
        return $total;
152
    }
153
154
    /**
155
     * {@inheritdoc}

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

@@ 438-452 (lines=15) @@
435
    /**
436
     * {@inheritdoc}
437
     */
438
    public function getAdjustmentsTotal($type = null)
439
    {
440
        if (null === $type) {
441
            return $this->adjustmentsTotal;
442
        }
443
444
        $total = 0;
445
        foreach ($this->getAdjustments($type) as $adjustment) {
446
            if (!$adjustment->isNeutral()) {
447
                $total += $adjustment->getAmount();
448
            }
449
        }
450
451
        return $total;
452
    }
453
454
    /**
455
     * {@inheritdoc}