Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 149-159 (lines=11) @@
146
                            }
147
148
                            /** @var \Eccube\Entity\Shipping $Shipping */
149
                            foreach ($Shippings as $Shipping) {
150
                                $shipmentItems = $Shipping->getShipmentItems();
151
                                /** @var \Eccube\Entity\ShipmentItem $ShipmentItem */
152
                                foreach ($shipmentItems as $ShipmentItem) {
153
                                    $ShipmentItem->setOrder($TargetOrder);
154
                                    $ShipmentItem->setShipping($Shipping);
155
                                    $app['orm.em']->persist($ShipmentItem);
156
                                }
157
                                $Shipping->setOrder($TargetOrder);
158
                                $app['orm.em']->persist($Shipping);
159
                            }
160
                        } else {
161
162
                            $NewShipmentItems = new ArrayCollection();
@@ 186-196 (lines=11) @@
183
                            }
184
                            // 配送商品の更新. delete/insert.
185
                            $Shippings = $TargetOrder->getShippings();
186
                            foreach ($Shippings as $Shipping) {
187
                                $ShipmentItems = $Shipping->getShipmentItems();
188
                                foreach ($ShipmentItems as $ShipmentItem) {
189
                                    $app['orm.em']->remove($ShipmentItem);
190
                                }
191
                                $ShipmentItems->clear();
192
                                foreach ($NewShipmentItems as $NewShipmentItem) {
193
                                    $NewShipmentItem->setShipping($Shipping);
194
                                    $ShipmentItems->add($NewShipmentItem);
195
                                }
196
                            }
197
                        }
198
199
                        $Customer = $TargetOrder->getCustomer();