Code Duplication    Length = 11-11 lines in 2 locations

src/Eccube/Controller/Admin/Order/EditController.php 2 locations

@@ 113-123 (lines=11) @@
110
                            }
111
112
                            /** @var \Eccube\Entity\Shipping $Shipping */
113
                            foreach ($Shippings as $Shipping) {
114
                                $shipmentItems = $Shipping->getShipmentItems();
115
                                /** @var \Eccube\Entity\ShipmentItem $ShipmentItem */
116
                                foreach ($shipmentItems as $ShipmentItem) {
117
                                    $ShipmentItem->setOrder($TargetOrder);
118
                                    $ShipmentItem->setShipping($Shipping);
119
                                    $app['orm.em']->persist($ShipmentItem);
120
                                }
121
                                $Shipping->setOrder($TargetOrder);
122
                                $app['orm.em']->persist($Shipping);
123
                            }
124
                        } else {
125
126
                            $NewShipmentItems = new ArrayCollection();
@@ 150-160 (lines=11) @@
147
                            }
148
                            // 配送商品の更新. delete/insert.
149
                            $Shippings = $TargetOrder->getShippings();
150
                            foreach ($Shippings as $Shipping) {
151
                                $ShipmentItems = $Shipping->getShipmentItems();
152
                                foreach ($ShipmentItems as $ShipmentItem) {
153
                                    $app['orm.em']->remove($ShipmentItem);
154
                                }
155
                                $ShipmentItems->clear();
156
                                foreach ($NewShipmentItems as $NewShipmentItem) {
157
                                    $NewShipmentItem->setShipping($Shipping);
158
                                    $ShipmentItems->add($NewShipmentItem);
159
                                }
160
                            }
161
                        }
162
163
                        $app['orm.em']->persist($TargetOrder);