src/GuzzleMiddleware.php
private function getAccessToken(AccessToken $invalid = null)
    {
        if (!isset($this->accessToken) || $this->accessToken->hasExpired() || ($invalid && $this->accessToken === $invalid)) {
            $this->accessToken = $this->acquireAccessToken();
            if (is_callable($this->tokenSave)) {
                call_user_func($this->tokenSave, $this->accessToken);
            }
        }

        return $this->accessToken;
    }
private function getAccessToken(AccessToken $invalid = null)
    {
        if (!isset($this->accessToken) || $this->accessToken->hasExpired() || ($invalid && $this->accessToken === $invalid)) {
            $this->accessToken = $this->acquireAccessToken();
            if (is_callable($this->tokenSave)) {
                call_user_func($this->tokenSave, $this->accessToken);
            }
        }

        return $this->accessToken;
    }
private function getAccessToken ( AccessToken $ invalid = null ) { if ( ! isset ( $ this -> accessToken ) || $ this -> accessToken -> hasExpired ( ) || ( $ invalid && $ this -> accessToken === $ invalid ) ) { $ this -> accessToken = $ this -> acquireAccessToken ( ) ; if ( is_callable ( $ this -> tokenSave ) ) { call_user_func ( $ this -> tokenSave , $ this -> accessToken ) ; } } return $ this -> accessToken ; }
Get the current access token.

@param AccessToken|null $invalid
A token to consider invalid.

@return \League\OAuth2\Client\Token\AccessToken
The OAuth2 access token.
Get the current access token .