src/Google/AdsApi/Common/Util/OAuth2TokenRefresher.php
public function getOrFetchAccessToken(
        FetchAuthTokenInterface $fetchAuthTokenInterface,
        callable $httpHandler = null
    ) {
        if ($this->shouldFetchAccessToken($fetchAuthTokenInterface)) {
            return $fetchAuthTokenInterface->fetchAuthToken($httpHandler)
            ['access_token'];
        }

        return $fetchAuthTokenInterface->getLastReceivedToken()['access_token'];
    }
public function getOrFetchAccessToken(
        FetchAuthTokenInterface $fetchAuthTokenInterface,
        callable $httpHandler = null
    ) {
        if ($this->shouldFetchAccessToken($fetchAuthTokenInterface)) {
            return $fetchAuthTokenInterface->fetchAuthToken($httpHandler)
            ['access_token'];
        }

        return $fetchAuthTokenInterface->getLastReceivedToken()['access_token'];
    }
public function getOrFetchAccessToken ( FetchAuthTokenInterface $ fetchAuthTokenInterface , callable $ httpHandler = null ) { if ( $ this -> shouldFetchAccessToken ( $ fetchAuthTokenInterface ) ) { return $ fetchAuthTokenInterface -> fetchAuthToken ( $ httpHandler ) [ 'access_token' ] ; } return $ fetchAuthTokenInterface -> getLastReceivedToken ( ) [ 'access_token' ] ; }
Gets the existing access token, or fetches a new one if an existing one is
about to expire within the refresh window, or fetches a new one if there is
no existing access token.

@param FetchAuthTokenInterface $fetchAuthTokenInterface the underlying
OAuth2 access token fetcher
@param callable|null $httpHandler the HTTP handler for making requests
to refresh OAuth2 credentials
@return string
Gets the existing access token or fetches a new one if an existing one is about to expire within the refresh window or fetches a new one if there is no existing access token .