Skip to content

Commit ea4198a

Browse files
authored
authenticate method refactored to use null coalescing operator (#48917)
1 parent 3d37d78 commit ea4198a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Illuminate/Auth/GuardHelpers.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ trait GuardHelpers
3333
*/
3434
public function authenticate()
3535
{
36-
if (! is_null($user = $this->user())) {
37-
return $user;
38-
}
39-
40-
throw new AuthenticationException;
36+
return $this->user() ?? throw new AuthenticationException;
4137
}
4238

4339
/**

0 commit comments

Comments
 (0)