Advertisement
Guest User

Untitled

a guest
May 26th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. class Guard {
  2.  
  3. ...
  4.  
  5. * @return UserContract
  6.      * @throws \Exception
  7.      */
  8.     public function user() :? UserContract
  9.     {
  10.         if (is_null($this->user) === false) {
  11.             return $this->user;
  12.         }
  13.  
  14.         try {
  15.             $token = $this->resolveToken($this->tokenGetter->getToken());
  16.         } catch (TokenNotPresentException $ex) {
  17.             return null;
  18.         }
  19.  
  20.         $this->claims = $token->getClaims();
  21.  
  22.         return $this->user = $token->getUser();
  23.     }
  24.  
  25. ...
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement