Code Duplication    Length = 13-13 lines in 2 locations

src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclHelper.php 1 location

@@ 171-183 (lines=13) @@
168
        // Security context does not provide anonymous role automatically.
169
        $uR = array('"IS_AUTHENTICATED_ANONYMOUSLY"');
170
171
        foreach ($userRoles as $role) {
172
            // The reason we ignore this is because by default FOSUserBundle adds ROLE_USER for every user
173
            if (is_string($role)) {
174
                if ($role !== 'ROLE_USER') {
175
                    $uR[] = '"' . $role . '"';
176
                }
177
            } else {
178
                // Symfony 3.4 compatibility
179
                if ($role->getRole() !== 'ROLE_USER') {
180
                    $uR[] = '"' . $role->getRole() . '"';
181
                }
182
            }
183
        }
184
        $uR = array_unique($uR);
185
        $inString = implode(' OR s.identifier = ', $uR);
186

src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclNativeHelper.php 1 location

@@ 104-116 (lines=13) @@
101
        // Security context does not provide anonymous role automatically.
102
        $uR = array('"IS_AUTHENTICATED_ANONYMOUSLY"');
103
104
        foreach ($userRoles as $role) {
105
            // The reason we ignore this is because by default FOSUserBundle adds ROLE_USER for every user
106
            if (is_string($role)) {
107
                if ($role !== 'ROLE_USER') {
108
                    $uR[] = '"' . $role . '"';
109
                }
110
            } else {
111
                // Symfony 3.4 compatibility
112
                if ($role->getRole() !== 'ROLE_USER') {
113
                    $uR[] = '"' . $role->getRole() . '"';
114
                }
115
            }
116
        }
117
        $uR = array_unique($uR);
118
        $inString = implode(' OR s.identifier = ', $uR);
119