Code Duplication    Length = 10-10 lines in 2 locations

src/Eccube/Controller/Admin/Product/ProductClassController.php 1 location

@@ 761-770 (lines=10) @@
758
        if ($this->BaseInfo->getOptionProductTaxRule() == Constant::ENABLED) {
759
            if ($productClassOrig->getTaxRate() !== false && $productClassOrig->getTaxRate() !== null) {
760
                $productClassDest->setTaxRate($productClassOrig->getTaxRate());
761
                if ($productClassDest->getTaxRule()) {
762
                    $productClassDest->getTaxRule()->setTaxRate($productClassOrig->getTaxRate());
763
                } else {
764
                    $taxrule = $this->taxRuleRepository->newTaxRule();
765
                    $taxrule->setTaxRate($productClassOrig->getTaxRate());
766
                    $taxrule->setApplyDate(new \DateTime());
767
                    $taxrule->setProduct($productClassDest->getProduct());
768
                    $taxrule->setProductClass($productClassDest);
769
                    $productClassDest->setTaxRule($taxrule);
770
                }
771
            } else {
772
                if ($productClassDest->getTaxRule()) {
773
                    $this->taxRuleRepository->delete($productClassDest->getTaxRule());

src/Eccube/Controller/Admin/Product/ProductController.php 1 location

@@ 441-450 (lines=10) @@
438
                    // 個別消費税
439
                    if ($this->BaseInfo->getOptionProductTaxRule() == Constant::ENABLED) {
440
                        if ($ProductClass->getTaxRate() !== null) {
441
                            if ($ProductClass->getTaxRule()) {
442
                                $ProductClass->getTaxRule()->setTaxRate($ProductClass->getTaxRate());
443
                            } else {
444
                                $taxrule = $this->taxRuleRepository->newTaxRule();
445
                                $taxrule->setTaxRate($ProductClass->getTaxRate());
446
                                $taxrule->setApplyDate(new \DateTime());
447
                                $taxrule->setProduct($Product);
448
                                $taxrule->setProductClass($ProductClass);
449
                                $ProductClass->setTaxRule($taxrule);
450
                            }
451
                        } else {
452
                            if ($ProductClass->getTaxRule()) {
453
                                $this->taxRuleRepository->delete($ProductClass->getTaxRule());