Skip to content

Commit

Permalink
authenticate method refactored to use null coalescing operator (#48917)
Browse files Browse the repository at this point in the history
  • Loading branch information
miladev95 authored Nov 5, 2023
1 parent 3d37d78 commit ea4198a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Illuminate/Auth/GuardHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ trait GuardHelpers
*/
public function authenticate()
{
if (! is_null($user = $this->user())) {
return $user;
}

throw new AuthenticationException;
return $this->user() ?? throw new AuthenticationException;
}

/**
Expand Down

0 comments on commit ea4198a

Please sign in to comment.