public function refreshToken()
    {
        if (is_null($this->token) || is_null($this->token->getRefreshToken())) {
            return null;
        }

        $grant = new RefreshToken();
        $refreshToken = $this->provider->getAccessToken($grant, [
            'refresh_token' => $this->token->getRefreshToken()
        ]);

        $this->token = $refreshToken;


        return $this->token;
    }
public function refreshToken()
    {
        if (is_null($this->token) || is_null($this->token->getRefreshToken())) {
            return null;
        }

        $grant = new RefreshToken();
        $refreshToken = $this->provider->getAccessToken($grant, [
            'refresh_token' => $this->token->getRefreshToken()
        ]);

        $this->token = $refreshToken;


        return $this->token;
    }
public function refreshToken ( ) { if ( is_null ( $ this -> token ) || is_null ( $ this -> token -> getRefreshToken ( ) ) ) { return null ; } $ grant = new RefreshToken ( ) ; $ refreshToken = $ this -> provider -> getAccessToken ( $ grant , [ 'refresh_token' => $ this -> token -> getRefreshToken ( ) ] ) ; $ this -> token = $ refreshToken ; return $ this -> token ; }
Refresh an expired token and generate a new AccessToken object.

@return \League\OAuth2\Client\Token\AccessToken|null
Refresh an expired token and generate a new AccessToken object .