Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 2064-2072 (lines=9) @@
2061
        return null !== $user && $this->getId() === $user->getId();
2062
    }
2063
2064
    public function removeRole($role)
2065
    {
2066
        if (false !== $key = array_search(strtoupper($role), $this->roles, true)) {
2067
            unset($this->roles[$key]);
2068
            $this->roles = array_values($this->roles);
2069
        }
2070
2071
        return $this;
2072
    }
2073
2074
    public function setUsername($username)
2075
    {

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

@@ 2182-2190 (lines=9) @@
2179
        return null !== $user && $this->getId() === $user->getId();
2180
    }
2181
2182
    public function removeRole($role)
2183
    {
2184
        if (false !== $key = array_search(strtoupper($role), $this->roles, true)) {
2185
            unset($this->roles[$key]);
2186
            $this->roles = array_values($this->roles);
2187
        }
2188
2189
        return $this;
2190
    }
2191
2192
    public function setUsername($username)
2193
    {