Code Duplication    Length = 9-9 lines in 2 locations

src/Eccube/Service/CartService.php 2 locations

@@ 304-312 (lines=9) @@
301
     */
302
    public function addProduct($ProductClass, $quantity = 1)
303
    {
304
        if (!$ProductClass instanceof ProductClass) {
305
            $ProductClassId = $ProductClass;
306
            $ProductClass = $this->entityManager
307
                ->getRepository(ProductClass::class)
308
                ->find($ProductClassId);
309
            if (is_null($ProductClass)) {
310
                return false;
311
            }
312
        }
313
314
        $ClassCategory1 = $ProductClass->getClassCategory1();
315
        if ($ClassCategory1 && !$ClassCategory1->isVisible()) {
@@ 336-344 (lines=9) @@
333
334
    public function removeProduct($ProductClass)
335
    {
336
        if (!$ProductClass instanceof ProductClass) {
337
            $ProductClassId = $ProductClass;
338
            $ProductClass = $this->entityManager
339
                ->getRepository(ProductClass::class)
340
                ->find($ProductClassId);
341
            if (is_null($ProductClass)) {
342
                return false;
343
            }
344
        }
345
346
        $removeItem = new CartItem();
347
        $removeItem->setPrice($ProductClass->getPrice02IncTax());