Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 47-52 (lines=6) @@
44
    public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context)
45
    {
46
        $OrderItemsByProductClass = [];
47
        foreach ($itemHolder->getItems() as $Item) {
48
            if ($Item->isProduct()) {
49
                $id = $Item->getProductClass()->getId();
50
                $OrderItemsByProductClass[$id][] = $Item;
51
            }
52
        }
53
54
        foreach ($OrderItemsByProductClass as $id => $Items) {
55
            $ProductClass = $this->productClassRepository->find($id);

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

@@ 47-52 (lines=6) @@
44
    public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context)
45
    {
46
        $OrderItemsByProductClass = [];
47
        foreach ($itemHolder->getItems() as $Item) {
48
            if ($Item->isProduct()) {
49
                $id = $Item->getProductClass()->getId();
50
                $OrderItemsByProductClass[$id][] = $Item;
51
            }
52
        }
53
54
        foreach ($OrderItemsByProductClass as $id => $Items) {
55
            $ProductClass = $this->productClassRepository->find($id);