Code Duplication    Length = 10-10 lines in 2 locations

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

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

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

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