Code Duplication    Length = 14-14 lines in 2 locations

src/Kunstmaan/NodeBundle/Helper/NodeMenu.php 2 locations

@@ 320-333 (lines=14) @@
317
        if (array_key_exists($node->getId(), $this->childNodes)) {
318
            $nodes = $this->childNodes[$node->getId()];
319
            /* @var Node $childNode */
320
            foreach ($nodes as $childNode) {
321
                $nodeTranslation = $childNode->getNodeTranslation(
322
                    $this->locale,
323
                    $this->includeOffline
324
                );
325
                if (!is_null($nodeTranslation)) {
326
                    $children[] = new NodeMenuItem(
327
                        $childNode,
328
                        $nodeTranslation,
329
                        false,
330
                        $this
331
                    );
332
                }
333
            }
334
335
            $children = array_filter(
336
                $children,
@@ 682-695 (lines=14) @@
679
        $topNodeMenuItems = array();
680
        $topNodes = $this->childNodes[0];
681
        /* @var Node $topNode */
682
        foreach ($topNodes as $topNode) {
683
            $nodeTranslation = $topNode->getNodeTranslation(
684
                $this->locale,
685
                $this->includeOffline
686
            );
687
            if (!is_null($nodeTranslation)) {
688
                $topNodeMenuItems[] = new NodeMenuItem(
689
                    $topNode,
690
                    $nodeTranslation,
691
                    null,
692
                    $this
693
                );
694
            }
695
        }
696
697
        return $topNodeMenuItems;
698
    }