Skip to content

Commit

Permalink
Rename client to httpClient
Browse files Browse the repository at this point in the history
  • Loading branch information
jordikroon committed Jan 13, 2018
1 parent 3cdfdd7 commit b6480bc
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/Vision.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@ class Vision
/**
* @var Client
*/
protected $client = null;
protected $httpClient;

/**
* @param string $apiKey
* @param Feature[] $features
* @param ImageContext|null $imageContext
* @param string $version
* @param Client|null $client
* @param Client|null $httpClient
*/
public function __construct(
$apiKey,
array $features = [],
ImageContext $imageContext = null,
$version = VisionRequest::VISION_VERSION,
Client $client = null
Client $httpClient = null
) {
$this->apiKey = $apiKey;
$this->version = $version;
$this->setFeatures($features);
$this->setImageContext($imageContext);
$this->client = $client;
$this->httpClient = $httpClient ?: new Client;
}

/**
Expand All @@ -75,7 +75,7 @@ public function request(
) {
$this->visionRequest = new VisionRequest($this->apiKey, $image, $this->features, $this->imageContext);
$this->visionRequest->setVersion($this->version);
$this->visionRequest->send($this->client);
$this->visionRequest->send($this->httpClient);

return $this->getResponseForType($responseType);
}
Expand Down Expand Up @@ -131,6 +131,22 @@ public function setImageContext($imageContext)
$this->imageContext = $imageContext ?: new ImageContext;
}

/**
* @return Client
*/
public function getHttpClient()
{
return $this->httpClient;
}

/**
* @param Client $httpClient
*/
public function setHttpClient($httpClient)
{
$this->httpClient = $httpClient;
}

/**
* @deprecated
*
Expand Down

0 comments on commit b6480bc

Please sign in to comment.