Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 126-136 (lines=11) @@
123
                            }
124
125
                            /** @var \Eccube\Entity\Shipping $Shipping */
126
                            foreach ($Shippings as $Shipping) {
127
                                $shipmentItems = $Shipping->getShipmentItems();
128
                                /** @var \Eccube\Entity\ShipmentItem $ShipmentItem */
129
                                foreach ($shipmentItems as $ShipmentItem) {
130
                                    $ShipmentItem->setOrder($TargetOrder);
131
                                    $ShipmentItem->setShipping($Shipping);
132
                                    $app['orm.em']->persist($ShipmentItem);
133
                                }
134
                                $Shipping->setOrder($TargetOrder);
135
                                $app['orm.em']->persist($Shipping);
136
                            }
137
                        } else {
138
139
                            $NewShipmentItems = new ArrayCollection();
@@ 163-173 (lines=11) @@
160
                            }
161
                            // 配送商品の更新. delete/insert.
162
                            $Shippings = $TargetOrder->getShippings();
163
                            foreach ($Shippings as $Shipping) {
164
                                $ShipmentItems = $Shipping->getShipmentItems();
165
                                foreach ($ShipmentItems as $ShipmentItem) {
166
                                    $app['orm.em']->remove($ShipmentItem);
167
                                }
168
                                $ShipmentItems->clear();
169
                                foreach ($NewShipmentItems as $NewShipmentItem) {
170
                                    $NewShipmentItem->setShipping($Shipping);
171
                                    $ShipmentItems->add($NewShipmentItem);
172
                                }
173
                            }
174
                        }
175
176
                        $app['orm.em']->persist($TargetOrder);