client = $config['client']; $this->assumeRoleParams = $config['assume_role_params']; } /** * Loads assume role credentials. * * @return PromiseInterface */ public function __invoke() { $client = $this->client; return $client->assumeRoleAsync($this->assumeRoleParams)->then(function (\UglyRobot\Infinite_Uploads\Aws\Result $result) { return $this->client->createCredentials($result); })->otherwise(function (\RuntimeException $exception) { throw new \UglyRobot\Infinite_Uploads\Aws\Exception\CredentialsException("Error in retrieving assume role credentials.", 0, $exception); }); } }