factory() public static method

Factory method to create a new AWS OpsWorks client using an array of configuration options.
public static factory ( array | Guzzle\Common\Collection $config = [] ) : self
$config array | Guzzle\Common\Collection Client configuration data
return self
 /**
  * @covers Aws\OpsWorks\OpsWorksClient::factory
  */
 public function testFactoryInitializesClient()
 {
     $client = OpsWorksClient::factory(array('key' => 'foo', 'secret' => 'bar', 'region' => 'us-east-1'));
     $this->assertInstanceOf('Aws\\Common\\Signature\\SignatureV4', $this->readAttribute($client, 'signature'));
     $this->assertInstanceOf('Aws\\Common\\Credentials\\Credentials', $client->getCredentials());
     $this->assertEquals('https://opsworks.us-east-1.amazonaws.com', $client->getBaseUrl());
 }
 public function __construct()
 {
     parent::__construct();
     // Get configuration values
     $path = realpath(__DIR__ . '/../../../../app/config/parameters.yml');
     $config = Yaml::parse($path);
     $this->parameters = $config['parameters'];
     // Create OpsWorks Client and update stack
     $this->client = OpsWorksClient::factory(array('key' => $this->parameters['aws_api_key'], 'secret' => $this->parameters['aws_api_secret'], 'region' => $this->parameters['aws_region']));
 }