Code Duplication    Length = 12-12 lines in 2 locations

src/Kunstmaan/AdminBundle/Helper/Menu/ModulesMenuAdaptor.php 1 location

@@ 22-33 (lines=12) @@
19
     */
20
    public function adaptChildren(MenuBuilder $menu, array &$children, MenuItem $parent = null, Request $request = null)
21
    {
22
        if (is_null($parent)) {
23
            $menuItem = new TopMenuItem($menu);
24
            $menuItem
25
                ->setRoute('KunstmaanAdminBundle_modules')
26
                ->setLabel('modules.title')
27
                ->setUniqueId('modules')
28
                ->setParent($parent);
29
            if (stripos($request->attributes->get('_route'), $menuItem->getRoute()) === 0) {
30
                $menuItem->setActive(true);
31
            }
32
            $children[] = $menuItem;
33
        }
34
    }
35
}
36

src/Kunstmaan/AdminBundle/Helper/Menu/SettingsMenuAdaptor.php 1 location

@@ 58-69 (lines=12) @@
55
            $children[] = $menuItem;
56
        } elseif ('KunstmaanAdminBundle_settings' == $parent->getRoute()) {
57
            if ($this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN')) {
58
                if ($this->isEnabledVersionChecker) {
59
                    $menuItem = new MenuItem($menu);
60
                    $menuItem
61
                        ->setRoute('KunstmaanAdminBundle_settings_bundle_version')
62
                        ->setLabel('settings.version.bundle')
63
                        ->setUniqueId('bundle_versions')
64
                        ->setParent($parent);
65
                    if (stripos($request->attributes->get('_route'), $menuItem->getRoute()) === 0) {
66
                        $menuItem->setActive(true);
67
                    }
68
                    $children[] = $menuItem;
69
                }
70
            }
71
        }
72