Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: laravel/framework
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8.x
Choose a base ref
...
head repository: craigballinger/framework
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8.x
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 2, 2021

  1. Return a new or existing guzzle client based on context

    Craig Ballinger committed Sep 2, 2021
    Copy the full SHA
    64ed229 View commit details
  2. StyleCI fixes

    Craig Ballinger committed Sep 2, 2021
    Copy the full SHA
    13d2e6f View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1fdc005 View commit details
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/Illuminate/Http/Client/PendingRequest.php
22 changes: 22 additions & 0 deletions src/Illuminate/Http/Client/PendingRequest.php
Original file line number Diff line number Diff line change
@@ -798,6 +798,28 @@ protected function populateResponse(Response $response)
* @return \GuzzleHttp\Client
*/
public function buildClient()
{
return $this->requestsReusableClient()
? $this->getReusableClient()
: $this->createClient($this->buildHandlerStack());
}

/**
* Determine if a reusable client is required.
*
* @return bool
*/
protected function requestsReusableClient()
{
return ! is_null($this->client) || $this->async;
}

/**
* Retrieve a reusable Guzzle client.
*
* @return \GuzzleHttp\Client
*/
protected function getReusableClient()
{
return $this->client = $this->client ?: $this->createClient($this->buildHandlerStack());
}