src/Oauth2Client.php
public function getAccessToken()
    {
        if ($this->accessToken && $this->accessToken->isExpired()) {
            // The access token has expired.
            $this->accessToken = null;
        }

        if (null === $this->accessToken) {
            // Try to acquire a new access token from the server.
            $this->accessToken = $this->acquireAccessToken();
            if ($this->accessToken) {
                $this->refreshToken = $this->accessToken->getRefreshToken() ?: null;
            }
        }

        return $this->accessToken;
    }
public function getAccessToken()
    {
        if ($this->accessToken && $this->accessToken->isExpired()) {
            // The access token has expired.
            $this->accessToken = null;
        }

        if (null === $this->accessToken) {
            // Try to acquire a new access token from the server.
            $this->accessToken = $this->acquireAccessToken();
            if ($this->accessToken) {
                $this->refreshToken = $this->accessToken->getRefreshToken() ?: null;
            }
        }

        return $this->accessToken;
    }
public function getAccessToken ( ) { if ( $ this -> accessToken && $ this -> accessToken -> isExpired ( ) ) { // The access token has expired. $ this -> accessToken = null ; } if ( null === $ this -> accessToken ) { // Try to acquire a new access token from the server. $ this -> accessToken = $ this -> acquireAccessToken ( ) ; if ( $ this -> accessToken ) { $ this -> refreshToken = $ this -> accessToken -> getRefreshToken ( ) ? : null ; } } return $ this -> accessToken ; }
Get the access token.

@return AccessToken|null Oauth2 access token
Get the access token .