Code Duplication    Length = 13-13 lines in 2 locations

src/Chamilo/PageBundle/Entity/User.php 1 location

@@ 1977-1989 (lines=13) @@
1974
     *
1975
     * @return array The roles
1976
     */
1977
    public function getRoles()
1978
    {
1979
        $roles = $this->roles;
1980
1981
        foreach ($this->getGroups() as $group) {
1982
            $roles = array_merge($roles, $group->getRoles());
1983
        }
1984
1985
        // we need to make sure to have at least one role
1986
        $roles[] = static::ROLE_DEFAULT;
1987
1988
        return array_unique($roles);
1989
    }
1990
1991
    /**
1992
     * Never use this to check if this user has access to anything!

src/Chamilo/UserBundle/Entity/User.php 1 location

@@ 2095-2107 (lines=13) @@
2092
     *
2093
     * @return array The roles
2094
     */
2095
    public function getRoles()
2096
    {
2097
        $roles = $this->roles;
2098
2099
        foreach ($this->getGroups() as $group) {
2100
            $roles = array_merge($roles, $group->getRoles());
2101
        }
2102
2103
        // we need to make sure to have at least one role
2104
        $roles[] = static::ROLE_DEFAULT;
2105
2106
        return array_unique($roles);
2107
    }
2108
2109
    /**
2110
     * Never use this to check if this user has access to anything!