Skip to content

Commit 7ea102e

Browse files
jdpedriedwsupplee
authored andcommitted
docs: Add note about cached access token (#1696)
* docs: Add note about cached access token * warn about clear cache
1 parent 7826dd0 commit 7ea102e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Google/Client.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,17 @@ public function isUsingApplicationDefaultCredentials()
416416
}
417417

418418
/**
419+
* Set the access token used for requests.
420+
*
421+
* Note that at the time requests are sent, tokens are cached. A token will be
422+
* cached for each combination of service and authentication scopes. If a
423+
* cache pool is not provided, creating a new instance of the client will
424+
* allow modification of access tokens. If a persistent cache pool is
425+
* provided, in order to change the access token, you must clear the cached
426+
* token by calling `$client->getCache()->clear()`. (Use caution in this case,
427+
* as calling `clear()` will remove all cache items, including any items not
428+
* related to Google API PHP Client.)
429+
*
419430
* @param string|array $token
420431
* @throws InvalidArgumentException
421432
*/

0 commit comments

Comments
 (0)