Code Duplication    Length = 9-9 lines in 2 locations

src/Eccube/Service/CartService.php 2 locations

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