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 fd449ba commit e04ea57
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions 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 e04ea57

Please sign in to comment.