Code Duplication    Length = 9-9 lines in 2 locations

src/Eccube/Service/CartService.php 2 locations

@@ 84-92 (lines=9) @@
81
82
    public function addProduct($ProductClass, $quantity = 1)
83
    {
84
        if (!$ProductClass instanceof ProductClass) {
85
            $ProductClassId = $ProductClass;
86
            $ProductClass = $this->em
87
                ->getRepository(ProductClass::class)
88
                ->find($ProductClassId);
89
            if (is_null($ProductClass)) {
90
                return false;
91
            }
92
        }
93
        $ClassCategory1 = $ProductClass->getClassCategory1();
94
        if ($ClassCategory1 && !$ClassCategory1->isVisible()) {
95
            return false;
@@ 122-130 (lines=9) @@
119
120
    public function removeProduct($ProductClass)
121
    {
122
        if (!$ProductClass instanceof ProductClass) {
123
            $ProductClassId = $ProductClass;
124
            $ProductClass = $this->em
125
                ->getRepository(ProductClass::class)
126
                ->find($ProductClassId);
127
            if (is_null($ProductClass)) {
128
                return false;
129
            }
130
        }
131
132
        /** @var Cart $cart */
133
        $cart = $this->getCart();