@@ -102,8 +102,8 @@ private function checkSecurityConfig(): void
102
102
if ($ securityConfig ->csrfProtection === 'cookie ' ) {
103
103
throw new SecurityException (
104
104
'Config\Security::$csrfProtection is set to \'cookie \'. '
105
- . ' Same-site attackers may bypass the CSRF protection. '
106
- . ' Please set it to \'session \'. '
105
+ . ' Same-site attackers may bypass the CSRF protection. '
106
+ . ' Please set it to \'session \'. '
107
107
);
108
108
}
109
109
}
@@ -137,7 +137,7 @@ public function attempt(array $credentials): Result
137
137
$ result = $ this ->check ($ credentials );
138
138
139
139
// Credentials mismatch.
140
- if (! $ result ->isOK ()) {
140
+ if (!$ result ->isOK ()) {
141
141
// Always record a login attempt, whether success or not.
142
142
$ this ->recordLoginAttempt ($ credentials , false , $ ipAddress , $ userAgent );
143
143
@@ -180,7 +180,7 @@ public function attempt(array $credentials): Result
180
180
181
181
$ this ->issueRememberMeToken ();
182
182
183
- if (! $ this ->hasAction ()) {
183
+ if (!$ this ->hasAction ()) {
184
184
$ this ->completeLogin ($ user );
185
185
}
186
186
@@ -291,10 +291,10 @@ private function recordLoginAttempt(
291
291
292
292
$ field = array_pop ($ field );
293
293
294
- if (! in_array ($ field , ['email ' , 'username ' ], true )) {
294
+ if (!in_array ($ field , ['email ' , 'username ' ], true )) {
295
295
$ idType = $ field ;
296
296
} else {
297
- $ idType = (! isset ($ credentials ['email ' ]) && isset ($ credentials ['username ' ]))
297
+ $ idType = (!isset ($ credentials ['email ' ]) && isset ($ credentials ['username ' ]))
298
298
? self ::ID_TYPE_USERNAME
299
299
: self ::ID_TYPE_EMAIL_PASSWORD ;
300
300
}
@@ -344,12 +344,11 @@ public function check(array $credentials): Result
344
344
$ passwords = service ('passwords ' );
345
345
346
346
// Now, try matching the passwords.
347
- if (! $ passwords ->verify ($ givenPassword , $ user ->password_hash )) {
348
- return new Result ([
349
- 'success ' => false ,
350
- 'reason ' => lang ('Auth.invalidPassword ' ),
351
- ]);
352
-
347
+ if (!$ passwords ->verify ($ givenPassword , $ user ->password_hash )) {
348
+ return new Result ([
349
+ 'success ' => false ,
350
+ 'reason ' => lang ('Auth.invalidPassword ' ),
351
+ ]);
353
352
}
354
353
355
354
// Check to see if the password needs to be rehashed.
@@ -651,10 +650,10 @@ public function startLogin(User $user): void
651
650
if ($ userId !== null ) {
652
651
throw new LogicException (
653
652
'The user has User Info in Session, so already logged in or in pending login state. '
654
- . ' If a logged in user logs in again with other account, the session data of the previous '
655
- . ' user will be used as the new user. '
656
- . ' Fix your code to prevent users from logging in without logging out or delete the session data. '
657
- . ' user_id: ' . $ userId
653
+ . ' If a logged in user logs in again with other account, the session data of the previous '
654
+ . ' user will be used as the new user. '
655
+ . ' Fix your code to prevent users from logging in without logging out or delete the session data. '
656
+ . ' user_id: ' . $ userId
658
657
);
659
658
}
660
659
@@ -739,18 +738,18 @@ public function login(User $user): void
739
738
if ($ this ->getIdentitiesForAction ($ user ) !== []) {
740
739
throw new LogicException (
741
740
'The user has identities for action, so cannot complete login. '
742
- . ' If you want to start to login with auth action, use startLogin() instead. '
743
- . ' Or delete identities for action in database. '
744
- . ' user_id: ' . $ user ->id
741
+ . ' If you want to start to login with auth action, use startLogin() instead. '
742
+ . ' Or delete identities for action in database. '
743
+ . ' user_id: ' . $ user ->id
745
744
);
746
745
}
747
746
// Check auth_action in Session
748
747
if ($ this ->getSessionKey ('auth_action ' )) {
749
748
throw new LogicException (
750
749
'The user has auth action in session, so cannot complete login. '
751
- . ' If you want to start to login with auth action, use startLogin() instead. '
752
- . ' Or delete `auth_action` and `auth_action_message` in session data. '
753
- . ' user_id: ' . $ user ->id
750
+ . ' If you want to start to login with auth action, use startLogin() instead. '
751
+ . ' Or delete `auth_action` and `auth_action_message` in session data. '
752
+ . ' user_id: ' . $ user ->id
754
753
);
755
754
}
756
755
@@ -893,7 +892,7 @@ public function getPendingUser(): ?User
893
892
*/
894
893
public function recordActiveDate (): void
895
894
{
896
- if (! $ this ->user instanceof User) {
895
+ if (!$ this ->user instanceof User) {
897
896
throw new InvalidArgumentException (
898
897
__METHOD__ . '() requires logged in user before calling. '
899
898
);
0 commit comments