public function unserialize($value)
 {
     $serialized = json_decode($value, true);
     parent::unserialize($serialized['credentials']);
     $this->customClient = $serialized['customClient'];
     $this->client = $this->customClient ? unserialize($serialized['client']) : InstanceMetadataClient::factory();
 }
コード例 #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);
 }