Code Duplication    Length = 8-9 lines in 2 locations

src/AppBundle/Entity/User.php 2 locations

@@ 154-161 (lines=8) @@
151
        return in_array($role, $this->getRoles(), true);
152
    }
153
154
    public function removeRole($role)
155
    {
156
        $role = strtoupper($role);
157
        if (array_key_exists($role, self::$roleMap)) {
158
            $this->roles ^= self::$roleMap[$role];
159
        }
160
        return $this;
161
    }
162
163
    public function setRoles(array $roles)
164
    {
@@ 172-180 (lines=9) @@
169
        return $this;
170
    }
171
172
    public function addRole($role)
173
    {
174
        $role = strtoupper($role);
175
        if (!array_key_exists($role, self::$roleMap)) {
176
            return $this;
177
        }
178
        $this->roles |= self::$roleMap[$role];
179
        return $this;
180
    }
181
182
    public function setPassword($password)
183
    {