credentials->isExpired()) { $this->refresh(); } return $this->credentials->getAccessKeyId(); } /** * {@inheritdoc} */ public function getSecretKey() { if ($this->credentials->isExpired()) { $this->refresh(); } return $this->credentials->getSecretKey(); } /** * {@inheritdoc} */ public function getSecurityToken() { if ($this->credentials->isExpired()) { $this->refresh(); } return $this->credentials->getSecurityToken(); } /** * {@inheritdoc} */ public function serialize() { if ($this->credentials->isExpired()) { $this->refresh(); } return $this->credentials->serialize(); } /** * Attempt to get new credentials */ abstract protected function refresh(); }