Code Duplication    Length = 6-8 lines in 2 locations

src/Kunstmaan/NodeBundle/Repository/NodeRepository.php 2 locations

@@ 92-97 (lines=6) @@
89
            }
90
        }
91
92
        if (\is_null($parentId)) {
93
            $qb->andWhere('b.parent is NULL');
94
        } elseif ($parentId !== false) {
95
            $qb->andWhere('b.parent = :parent')
96
                ->setParameter('parent', $parentId);
97
        }
98
        if ($rootNode) {
99
            $qb->andWhere('b.lft >= :left')
100
                ->andWhere('b.rgt <= :right')
@@ 484-491 (lines=8) @@
481
            $qb->andWhere('t.online = true');
482
        }
483
484
        if (\is_null($parentId)) {
485
            $qb->andWhere('n.parent is NULL');
486
        } elseif ($parentId === false) {
487
            // Do nothing
488
        } else {
489
            $qb->andWhere('n.parent = :parent')
490
                ->setParameter('parent', $parentId);
491
        }
492
493
        $query = $qb->getQuery();
494