token = [ 'access_token' => $accessToken, 'expires_at' => time() + $expiresIn, ]; } /** * Returns the static access token supplied to the constructor. * * @param callable|null $httpHandler Unused; present for interface compatibility. * @return array{access_token: string, expires_at: int} */ public function fetchAuthToken(?callable $httpHandler = null) { return $this->token; } /** * Returns a cache key derived from the supplied token. Caching a static token * has no real benefit, but a stable, token-specific key ensures a shared cache * pool never returns another credential's token. * * @return string */ public function getCacheKey() { return 'static_credentials_' . md5($this->token['access_token']); } /** * @return array{access_token: string, expires_at: int} */ public function getLastReceivedToken() { return $this->token; } }