public function setCommonDefaults(array $config)
{
$config += ['authCache' => new MemoryCacheItemPool(), 'authCacheOptions' => [], 'credentialsFetcher' => null, 'keyFile' => null, 'retries' => null, 'scopes' => null];
if ($config['credentialsFetcher'] && !$config['credentialsFetcher'] instanceof FetchAuthTokenInterface) {
throw new \InvalidArgumentException('credentialsFetcher must implement FetchAuthTokenInterface.');
}
if (!$config['authCache'] instanceof CacheItemPoolInterface) {
throw new \InvalidArgumentException('authCache must implement CacheItemPoolInterface.');
}
$this->authCache = $config['authCache'];
$this->authCacheOptions = $config['authCacheOptions'];
$this->credentialsFetcher = $config['credentialsFetcher'];
$this->retries = $config['retries'];
$this->scopes = $config['scopes'];
$this->keyFile = $config['keyFile'];
}