Code Duplication    Length = 9-9 lines in 2 locations

src/Eccube/Service/CartService.php 2 locations

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