Code Duplication    Length = 12-12 lines in 3 locations

src/Eccube/Service/PurchaseFlow/Processor/SaleLimitMultipleValidator.php 1 location

@@ 71-82 (lines=12) @@
68
        }
69
    }
70
71
    protected function formatProductName(ProductClass $ProductClass)
72
    {
73
        $productName = $ProductClass->getProduct()->getName();
74
        if ($ProductClass->hasClassCategory1()) {
75
            $productName .= ' - '.$ProductClass->getClassCategory1()->getName();
76
        }
77
        if ($ProductClass->hasClassCategory2()) {
78
            $productName .= ' - '.$ProductClass->getClassCategory2()->getName();
79
        }
80
81
        return $productName;
82
    }
83
}
84

src/Eccube/Service/PurchaseFlow/Processor/StockMultipleValidator.php 1 location

@@ 74-85 (lines=12) @@
71
        }
72
    }
73
74
    protected function formatProductName(ProductClass $ProductClass)
75
    {
76
        $productName = $ProductClass->getProduct()->getName();
77
        if ($ProductClass->hasClassCategory1()) {
78
            $productName .= ' - '.$ProductClass->getClassCategory1()->getName();
79
        }
80
        if ($ProductClass->hasClassCategory2()) {
81
            $productName .= ' - '.$ProductClass->getClassCategory2()->getName();
82
        }
83
84
        return $productName;
85
    }
86
}
87

src/Eccube/Service/PurchaseFlow/InvalidItemException.php 1 location

@@ 50-61 (lines=12) @@
47
    /**
48
     * @return InvalidItemException
49
     */
50
    public static function fromProductClass($errorMessage, ProductClass $ProductClass)
51
    {
52
        $productName = $ProductClass->getProduct()->getName();
53
        if ($ProductClass->hasClassCategory1()) {
54
            $productName .= ' - '.$ProductClass->getClassCategory1()->getName();
55
        }
56
        if ($ProductClass->hasClassCategory2()) {
57
            $productName .= ' - '.$ProductClass->getClassCategory2()->getName();
58
        }
59
60
        return new self($errorMessage, ['%product%' => $productName]);
61
    }
62
}
63