Code Duplication    Length = 7-7 lines in 4 locations

htdocs_symfony/src/Components/Subscriber/MenuSubscriber.php 4 locations

@@ 40-46 (lines=7) @@
37
            'childOptions' => $event->getChildOptions()
38
        ])->setAttribute('class', 'header');
39
40
        if ($this->security->isGranted("CAN_VIEW", UserEntity::class)) {
41
            $userMenu = $menu->addChild('cache', [
42
                'label' => 'Caches',
43
                'route' => 'backend_caches_index',
44
                'childOptions' => $event->getChildOptions(),
45
            ])->setLabelAttribute('icon', 'fas fa-map-marker-alt');
46
        }
47
48
        if ($this->security->isGranted("CAN_VIEW", UserEntity::class)) {
49
            $userMenu = $menu->addChild('user', [
@@ 48-54 (lines=7) @@
45
            ])->setLabelAttribute('icon', 'fas fa-map-marker-alt');
46
        }
47
48
        if ($this->security->isGranted("CAN_VIEW", UserEntity::class)) {
49
            $userMenu = $menu->addChild('user', [
50
                'label' => 'Users',
51
                'route' => 'backend_user_index',
52
                'childOptions' => $event->getChildOptions(),
53
            ])->setLabelAttribute('icon', 'fas fa-users');
54
        }
55
56
        if ($this->security->isGranted("CAN_VIEW", UserEntity::class)) { // ??
57
            $userMenu = $menu->addChild('settings', [
@@ 56-62 (lines=7) @@
53
            ])->setLabelAttribute('icon', 'fas fa-users');
54
        }
55
56
        if ($this->security->isGranted("CAN_VIEW", UserEntity::class)) { // ??
57
            $userMenu = $menu->addChild('settings', [
58
                'label' => 'Settings',
59
                'route' => 'backend_settings_index',
60
                'childOptions' => $event->getChildOptions(),
61
            ])->setLabelAttribute('icon', 'fas fa-cogs');
62
        }
63
64
        if ($this->security->isGranted("CAN_VIEW", UserEntity::class)) {
65
            $userMenu = $menu->addChild('kitchensink', [
@@ 64-70 (lines=7) @@
61
            ])->setLabelAttribute('icon', 'fas fa-cogs');
62
        }
63
64
        if ($this->security->isGranted("CAN_VIEW", UserEntity::class)) {
65
            $userMenu = $menu->addChild('kitchensink', [
66
                'label' => 'Kitchensink',
67
                'route' => 'app_kitchensink_index',
68
                'childOptions' => $event->getChildOptions(),
69
            ])->setLabelAttribute('icon', 'fab fa-css3');
70
        }
71
    }
72
}
73