Code Duplication    Length = 14-15 lines in 2 locations

src/Eccube/Service/Calculator/Strategy/ChargeStrategy.php 1 location

@@ 34-48 (lines=15) @@
31
        $TaxInclude = $this->app['orm.em']->getRepository(TaxDisplayType::class)->find(TaxDisplayType::INCLUDED);
32
        $Taxion = $this->app['orm.em']->getRepository(TaxType::class)->find(TaxType::TAXATION);
33
34
        if (!$ShipmentItems->hasItemByOrderItemType($ChargeType)) {
35
            $Payment = $this->Order->getPayment();
36
            if (is_object($Payment) && $Payment->getCharge() > 0) {
37
                $ShipmentItem = new ShipmentItem();
38
                $ShipmentItem->setProductName("手数料")
39
                    ->setPrice($Payment->getCharge())
40
                    ->setPriceIncTax($Payment->getCharge())
41
                    ->setTaxRate(8)
42
                    ->setQuantity(1)
43
                    ->setOrderItemType($ChargeType)
44
                    ->setTaxDisplayType($TaxInclude)
45
                    ->setTaxType($Taxion);
46
                $ShipmentItems->add($ShipmentItem);
47
            }
48
        }
49
    }
50
51
    public function setApplication(Application $app)

src/Eccube/Service/Calculator/Strategy/ShippingStrategy.php 1 location

@@ 38-51 (lines=14) @@
35
        foreach ($this->Order->getShippings() as $Shipping) {
36
            /* @var Shipping $Shipping */
37
            $sio = new ShipmentItemCollection($Shipping->getShipmentItems()->toArray());
38
            if (!$sio->hasItemByOrderItemType($DeliveryFeeType)) {
39
                $ShipmentItem = new ShipmentItem();
40
                $ShipmentItem->setProductName("送料")
41
                    ->setPrice($Shipping->getShippingDeliveryFee())
42
                    ->setPriceIncTax($Shipping->getShippingDeliveryFee())
43
                    ->setTaxRate(8)
44
                    ->setQuantity(1)
45
                    ->setOrderItemType($DeliveryFeeType)
46
                    ->setShipping($Shipping)
47
                    ->setTaxDisplayType($TaxInclude)
48
                    ->setTaxType($Taxion);
49
                $ShipmentItems->add($ShipmentItem);
50
                $Shipping->addShipmentItem($ShipmentItem);
51
            }
52
        }
53
    }
54