Code Duplication    Length = 10-11 lines in 2 locations

src/Eccube/Repository/ProductRepository.php 2 locations

@@ 96-106 (lines=11) @@
93
94
        // category
95
        $categoryJoin = false;
96
        if (!empty($searchData['category_id']) && $searchData['category_id']) {
97
            $Categories = $searchData['category_id']->getSelfAndDescendants();
98
            if ($Categories) {
99
                $qb
100
                    ->innerJoin('p.ProductCategories', 'pct')
101
                    ->innerJoin('pct.Category', 'c')
102
                    ->andWhere($qb->expr()->in('pct.Category', ':Categories'))
103
                    ->setParameter('Categories', $Categories);
104
                $categoryJoin = true;
105
            }
106
        }
107
108
        // name
109
        if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) {
@@ 206-215 (lines=10) @@
203
       */
204
205
        // category
206
        if (!empty($searchData['category_id']) && $searchData['category_id']) {
207
            $Categories = $searchData['category_id']->getSelfAndDescendants();
208
            if ($Categories) {
209
                $qb
210
                    ->innerJoin('p.ProductCategories', 'pct')
211
                    ->innerJoin('pct.Category', 'c')
212
                    ->andWhere($qb->expr()->in('pct.Category', ':Categories'))
213
                    ->setParameter('Categories', $Categories);
214
            }
215
        }
216
217
        // status
218
        if (!empty($searchData['status']) && $searchData['status']->toArray()) {