Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 91-99 (lines=9) @@
88
        $token = $this->tokenStorage->getToken();
89
        $userRoles = [];
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 = ['"IS_AUTHENTICATED_ANONYMOUSLY"'];

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

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