/**
  * Constructs a new instance profile credentials decorator
  *
  * @param CredentialsInterface   $credentials Credentials to adapt
  * @param InstanceMetadataClient $client      Client used to get new credentials
  */
 public function __construct(CredentialsInterface $credentials, InstanceMetadataClient $client = null)
 {
     parent::__construct($credentials);
     $this->setClient($client);
 }
Example #2
0
 /**
  * CacheableCredentials is a decorator that decorates other credentials
  *
  * @param CredentialsInterface  $credentials Credentials to adapt
  * @param CacheAdapterInterface $cache       Cache to use to store credentials
  * @param string                $cacheKey    Cache key of the credentials
  */
 public function __construct(CredentialsInterface $credentials, CacheAdapterInterface $cache, $cacheKey)
 {
     $this->cache = $cache;
     $this->cacheKey = $cacheKey;
     parent::__construct($credentials);
 }