Code Duplication    Length = 9-9 lines in 2 locations

src/Eccube/Service/CartService.php 2 locations

@@ 281-289 (lines=9) @@
278
     */
279
    public function addProduct($ProductClass, $quantity = 1)
280
    {
281
        if (!$ProductClass instanceof ProductClass) {
282
            $ProductClassId = $ProductClass;
283
            $ProductClass = $this->entityManager
284
                ->getRepository(ProductClass::class)
285
                ->find($ProductClassId);
286
            if (is_null($ProductClass)) {
287
                return false;
288
            }
289
        }
290
291
        $ClassCategory1 = $ProductClass->getClassCategory1();
292
        if ($ClassCategory1 && !$ClassCategory1->isVisible()) {
@@ 313-321 (lines=9) @@
310
311
    public function removeProduct($ProductClass)
312
    {
313
        if (!$ProductClass instanceof ProductClass) {
314
            $ProductClassId = $ProductClass;
315
            $ProductClass = $this->entityManager
316
                ->getRepository(ProductClass::class)
317
                ->find($ProductClassId);
318
            if (is_null($ProductClass)) {
319
                return false;
320
            }
321
        }
322
323
        $removeItem = new CartItem();
324
        $removeItem->setPrice($ProductClass->getPrice02IncTax());