Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 158-166 (lines=9) @@
155
        $token = $this->tokenStorage->getToken();
156
        $userRoles = array();
157
        $user = null;
158
        if (!\is_null($token)) {
159
            $user = $token->getUser();
160
            if (method_exists($this->roleHierarchy, 'getReachableRoleNames')) {
161
                $userRoles = $this->roleHierarchy->getReachableRoleNames($token->getRoleNames());
162
            } else {
163
                // Symfony 3.4 compatibility
164
                $userRoles = $this->roleHierarchy->getReachableRoles($token->getRoles());
165
            }
166
        }
167
168
        // Security context does not provide anonymous role automatically.
169
        $uR = array('"IS_AUTHENTICATED_ANONYMOUSLY"');

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

@@ 91-99 (lines=9) @@
88
        $token = $this->tokenStorage->getToken();
89
        $userRoles = array();
90
        $user = null;
91
        if (!\is_null($token)) {
92
            $user = $token->getUser();
93
            if (method_exists($this->roleHierarchy, 'getReachableRoleNames')) {
94
                $userRoles = $this->roleHierarchy->getReachableRoleNames($token->getRoleNames());
95
            } else {
96
                // Symfony 3.4 compatibility
97
                $userRoles = $this->roleHierarchy->getReachableRoles($token->getRoles());
98
            }
99
        }
100
101
        // Security context does not provide anonymous role automatically.
102
        $uR = array('"IS_AUTHENTICATED_ANONYMOUSLY"');