Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 2068-2080 (lines=13) @@
2065
     *
2066
     * @return array The roles
2067
     */
2068
    public function getRoles()
2069
    {
2070
        $roles = $this->roles;
2071
2072
        foreach ($this->getGroups() as $group) {
2073
            $roles = array_merge($roles, $group->getRoles());
2074
        }
2075
2076
        // we need to make sure to have at least one role
2077
        $roles[] = static::ROLE_DEFAULT;
2078
2079
        return array_unique($roles);
2080
    }
2081
2082
    /**
2083
     * Never use this to check if this user has access to anything!

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

@@ 2142-2154 (lines=13) @@
2139
     *
2140
     * @return array The roles
2141
     */
2142
    public function getRoles()
2143
    {
2144
        $roles = $this->roles;
2145
2146
        foreach ($this->getGroups() as $group) {
2147
            $roles = array_merge($roles, $group->getRoles());
2148
        }
2149
2150
        // we need to make sure to have at least one role
2151
        $roles[] = static::ROLE_DEFAULT;
2152
2153
        return array_unique($roles);
2154
    }
2155
2156
    /**
2157
     * Never use this to check if this user has access to anything!