Code Duplication    Length = 8-8 lines in 2 locations

src/Eccube/Service/CartService.php 2 locations

@@ 212-219 (lines=8) @@
209
     */
210
    public function generateCartItem($ProductClass)
211
    {
212
        if (!$ProductClass instanceof ProductClass) {
213
            $ProductClass = $this->entityManager
214
                ->getRepository('Eccube\Entity\ProductClass')
215
                ->find($ProductClass);
216
            if (!$ProductClass) {
217
                throw new CartException('cart.product.delete');
218
            }
219
        }
220
        $CartItem = new CartItem();
221
        $CartItem
222
            ->setClassName('Eccube\Entity\ProductClass')
@@ 402-409 (lines=8) @@
399
     */
400
    public function setProductQuantity($ProductClass, $quantity)
401
    {
402
        if (!$ProductClass instanceof ProductClass) {
403
            $ProductClass = $this->entityManager
404
                ->getRepository('Eccube\Entity\ProductClass')
405
                ->find($ProductClass);
406
            if (!$ProductClass) {
407
                throw new CartException('cart.product.delete');
408
            }
409
        }
410
411
        if (!$this->isProductDisplay($ProductClass)) {
412
            throw new CartException('cart.product.not.status');