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 (Result $result) { return $this->client->createCredentials($result); })->otherwise(function (\RuntimeException $exception) { throw new CredentialsException( "Error in retrieving assume role credentials.", 0, $exception ); }); } }