Code Duplication    Length = 9-9 lines in 2 locations

src/Eccube/Service/CartService.php 2 locations

@@ 180-188 (lines=9) @@
177
     */
178
    public function addProduct($ProductClass, $quantity = 1)
179
    {
180
        if (!$ProductClass instanceof ProductClass) {
181
            $ProductClassId = $ProductClass;
182
            $ProductClass = $this->em
183
                ->getRepository(ProductClass::class)
184
                ->find($ProductClassId);
185
            if (is_null($ProductClass)) {
186
                return false;
187
            }
188
        }
189
190
        $ClassCategory1 = $ProductClass->getClassCategory1();
191
        if ($ClassCategory1 && !$ClassCategory1->isVisible()) {
@@ 213-221 (lines=9) @@
210
211
    public function removeProduct($ProductClass)
212
    {
213
        if (!$ProductClass instanceof ProductClass) {
214
            $ProductClassId = $ProductClass;
215
            $ProductClass = $this->em
216
                ->getRepository(ProductClass::class)
217
                ->find($ProductClassId);
218
            if (is_null($ProductClass)) {
219
                return false;
220
            }
221
        }
222
223
        $removeItem = new CartItem();
224
        $removeItem->setPrice($ProductClass->getPrice01IncTax());