Code Duplication    Length = 19-19 lines in 2 locations

src/system/RoutesModule/Container/Base/AbstractLinkContainer.php 2 locations

@@ 98-116 (lines=19) @@
95
        $links = [];
96
97
        
98
        if (LinkContainerInterface::TYPE_ADMIN == $type) {
99
            if ($this->permissionApi->hasPermission($this->getBundleName() . '::', '::', ACCESS_READ)) {
100
                $links[] = [
101
                    'url' => $this->router->generate('zikularoutesmodule_user_index'),
102
                    'text' => $this->__('Frontend'),
103
                    'title' => $this->__('Switch to user area.'),
104
                    'icon' => 'home'
105
                ];
106
            }
107
            
108
            if (in_array('route', $allowedObjectTypes)
109
                && $this->permissionApi->hasPermission($this->getBundleName() . ':Route:', '::', $permLevel)) {
110
                $links[] = [
111
                    'url' => $this->router->generate('zikularoutesmodule_route_adminview'),
112
                     'text' => $this->__('Routes'),
113
                     'title' => $this->__('Route list')
114
                 ];
115
            }
116
        }
117
        if (LinkContainerInterface::TYPE_USER == $type) {
118
            if ($this->permissionApi->hasPermission($this->getBundleName() . '::', '::', ACCESS_ADMIN)) {
119
                $links[] = [
@@ 117-135 (lines=19) @@
114
                 ];
115
            }
116
        }
117
        if (LinkContainerInterface::TYPE_USER == $type) {
118
            if ($this->permissionApi->hasPermission($this->getBundleName() . '::', '::', ACCESS_ADMIN)) {
119
                $links[] = [
120
                    'url' => $this->router->generate('zikularoutesmodule_admin_index'),
121
                    'text' => $this->__('Backend'),
122
                    'title' => $this->__('Switch to administration area.'),
123
                    'icon' => 'wrench'
124
                ];
125
            }
126
            
127
            if (in_array('route', $allowedObjectTypes)
128
                && $this->permissionApi->hasPermission($this->getBundleName() . ':Route:', '::', $permLevel)) {
129
                $links[] = [
130
                    'url' => $this->router->generate('zikularoutesmodule_route_view'),
131
                     'text' => $this->__('Routes'),
132
                     'title' => $this->__('Route list')
133
                 ];
134
            }
135
        }
136
137
        return $links;
138
    }