Code Duplication    Length = 5-5 lines in 3 locations

Security/User/LdapUserChecker.php 3 locations

@@ 37-41 (lines=5) @@
34
     */
35
    public function checkLdapErrorCode(UserInterface $user, $code, $ldapType)
36
    {
37
        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountLocked) {
38
            $ex = new LockedException('User account is locked.');
39
            $ex->setUser($user);
40
            throw $ex;
41
        }
42
43
        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountPasswordMustChange) {
44
            $ex = new CredentialsExpiredException('User credentials have expired.');
@@ 43-47 (lines=5) @@
40
            throw $ex;
41
        }
42
43
        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountPasswordMustChange) {
44
            $ex = new CredentialsExpiredException('User credentials have expired.');
45
            $ex->setUser($user);
46
            throw $ex;
47
        }
48
49
        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountDisabled) {
50
            $ex = new DisabledException('User account is disabled.');
@@ 49-53 (lines=5) @@
46
            throw $ex;
47
        }
48
49
        if ($ldapType == LdapConnection::TYPE_AD && $code == ResponseCode::AccountDisabled) {
50
            $ex = new DisabledException('User account is disabled.');
51
            $ex->setUser($user);
52
            throw $ex;
53
        }
54
    }
55
}
56