Code Duplication    Length = 7-9 lines in 3 locations

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

@@ 224-232 (lines=9) @@
221
                $includeHiddenFromNav = $this->includeHiddenFromNav;
222
                $this->topNodeMenuItems = array_filter(
223
                    $topNodeMenuItems,
224
                    function (NodeMenuItem $entry) use ($includeHiddenFromNav) {
225
                        if ($entry->getNode()->isHiddenFromNav(
226
                            ) && !$includeHiddenFromNav
227
                        ) {
228
                            return false;
229
                        }
230
231
                        return true;
232
                    }
233
                );
234
            }
235
        }
@@ 337-345 (lines=9) @@
334
335
            $children = array_filter(
336
                $children,
337
                function (NodeMenuItem $entry) use ($includeHiddenFromNav) {
338
                    if ($entry->getNode()->isHiddenFromNav(
339
                        ) && !$includeHiddenFromNav
340
                    ) {
341
                        return false;
342
                    }
343
344
                    return true;
345
                }
346
            );
347
        }
348

src/Kunstmaan/NodeBundle/Helper/NodeMenuItem.php 1 location

@@ 219-225 (lines=7) @@
216
            $this->children = $children;
217
        }
218
219
        $children = array_filter($this->children, function (NodeMenuItem $entry) use ($includeHiddenFromNav) {
220
            if ($entry->getNode()->isHiddenFromNav() && !$includeHiddenFromNav) {
221
                return false;
222
            }
223
224
            return true;
225
        });
226
227
        return $children;
228
    }