Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Common/Internal/Http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ class HttpClient implements IHttpClient
*
* @param string $certificatePath The certificate path
* @param string $certificateAuthorityPath The path of the certificate authority
* @param array $options Array of options for guzzle
*/
public function __construct(
$certificatePath = Resources::EMPTY_STRING,
$certificateAuthorityPath = Resources::EMPTY_STRING
$certificateAuthorityPath = Resources::EMPTY_STRING,
$options = array()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, declare the argument type.

) {
$this->_config = [
Resources::USE_BRACKETS => true,
Expand All @@ -127,6 +129,8 @@ public function __construct(

$this->_requestUrl = null;
$this->_expectedStatusCodes = [];

$this->_config = array_merge($this->_config, $options);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the provided options be validated before hydrating $this->_config? (by instance, with an options resolver). BTW, if they are intended to be an associative array, + operator could be used instead of calling array_merge().

}

/**
Expand Down
10 changes: 6 additions & 4 deletions src/Common/ServicesBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ class ServicesBuilder
/**
* Gets the HTTP client used in the REST services construction.
*
* @param array $options Array of options for guzzle
*
* @return IHttpClient
*/
protected function httpClient()
protected function httpClient($options = array())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this is a BC break (the method is extensible).

{
return new HttpClient();
return new HttpClient(Resources::EMPTY_STRING, Resources::EMPTY_STRING, $options);
}

/**
Expand Down Expand Up @@ -216,13 +218,13 @@ public function createTableService($connectionString)
*
* @return IServiceBus
*/
public function createServiceBusService($connectionString)
public function createServiceBusService($connectionString, $options = array())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this is a BC break (the method is extensible).

{
$settings = ServiceBusSettings::createFromConnectionString(
$connectionString
);

$httpClient = $this->httpClient();
$httpClient = $this->httpClient($options);
$serializer = $this->serializer();
$serviceBusWrapper = new ServiceBusRestProxy(
$httpClient,
Expand Down