credential = $credential; $this->config = $config; } /** * Get the credentials from the cache in the validity period. * * @return array|null */ public function getCredentialsInCache() { if (isset(self::$credentialsCache[(string)$this->credential])) { $result = self::$credentialsCache[(string)$this->credential]; if (\strtotime($result['Expiration']) - \time() >= $this->expirationSlot) { return $result; } } return null; } /** * Cache credentials. * * @param array $credential */ protected function cache(array $credential) { self::$credentialsCache[(string)$this->credential] = $credential; } }