Code Duplication    Length = 14-14 lines in 2 locations

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

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