Skip to content

Commit

Permalink
Merge pull request #9 from mingyoung/patch-1
Browse files Browse the repository at this point in the history
update
  • Loading branch information
overtrue committed Jan 13, 2019
2 parents 8eda0ce + 01a4c07 commit ddae518
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
20 changes: 4 additions & 16 deletions src/Client.php
Expand Up @@ -108,7 +108,7 @@ public function upload(string $url, array $files = [], array $form = [], array $

foreach ($files as $name => $path) {
$multipart[] = [
'name' => $name,
'name' => $name,
'contents' => fopen($path, 'r'),
];
}
Expand Down Expand Up @@ -155,26 +155,14 @@ public function requestRaw(string $url, string $method = 'GET', array $options =
return Response::buildFromPsrResponse($this->request($url, $method, $options, true));
}

/**
* @param \GuzzleHttp\Client $client
*
* @return \Overtrue\Http\Client
*/
public function setHttpClient(GuzzleClient $client): \Overtrue\Http\Client
{
$this->httpClient = $client;

return $this;
}

/**
* Return GuzzleHttp\Client instance.
*
* @return \GuzzleHttp\Client
* @return \GuzzleHttp\ClientInterface
*/
public function getHttpClient(): \GuzzleHttp\Client
public function getHttpClient(): \GuzzleHttp\ClientInterface
{
if (!($this->httpClient instanceof GuzzleClient)) {
if (!$this->httpClient) {
$this->httpClient = new GuzzleClient($this->config->toArray());
}

Expand Down
6 changes: 3 additions & 3 deletions src/Config.php
Expand Up @@ -24,10 +24,10 @@ class Config
* @var array
*/
protected $options = [
'base_uri' => null,
'timeout' => 3000,
'base_uri' => null,
'timeout' => 3000,
'connect_timeout' => 3000,
'proxy' => [],
'proxy' => [],
];

/**
Expand Down

0 comments on commit ddae518

Please sign in to comment.