Skip to content

Commit

Permalink
Merge pull request #2 from boite/master
Browse files Browse the repository at this point in the history
Fix broken BergenAdapter build.
  • Loading branch information
joostfaassen committed May 30, 2017
2 parents 5b58281 + 199f996 commit 3a630b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Adapter/BergenAdapter.php
Expand Up @@ -22,20 +22,20 @@ public static function build(array $config)
'Unable to build BergenAdapter: missing "host" from configuration.'
);
}
$config = [
$clientOpts = [
ClientOptions::API_HOST => trim($config['host']),
];
if (isset($config['username']) && isset($config['password'])) {
$config[RequestOptions::AUTH] = [
$clientOpts[RequestOptions::AUTH] = [
trim($config['username']),
$config['password'],
];
}
if (array_key_exists('secure', $config)) {
$config[ClientOptions::SECURE_HTTP] = (bool) $config['secure'];
$clientOpts[ClientOptions::SECURE_HTTP] = (bool) $config['secure'];
}

return new self(new V1StorageClient(new ClientBuilder($config)));
return new self(new V1StorageClient(new ClientBuilder($clientOpts)));
}

public function __construct(V1StorageClient $client)
Expand Down

0 comments on commit 3a630b3

Please sign in to comment.