Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jun 4, 2021
1 parent 571d705 commit 96518b9
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/Illuminate/Http/Client/PendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class PendingRequest
*
* @var \Illuminate\Http\Client\Request|null
*/
protected $request = null;
protected $request;

/**
* Create a new HTTP Client instance.
Expand All @@ -156,11 +156,11 @@ public function __construct(Factory $factory = null)
'http_errors' => false,
];

$this->beforeSendingCallbacks = collect([function (Request $request, array $options, PendingRequest $instance) {
$instance->request = $request;
$instance->cookies = $options['cookies'];
$this->beforeSendingCallbacks = collect([function (Request $request, array $options, PendingRequest $pendingRequest) {
$pendingRequest->request = $request;
$pendingRequest->cookies = $options['cookies'];

$instance->dispatchRequestSendingEvent();
$pendingRequest->dispatchRequestSendingEvent();
}]);
}

Expand Down Expand Up @@ -986,11 +986,8 @@ protected function dispatchRequestSendingEvent()
*/
protected function dispatchResponseReceivedEvent(Response $response)
{
if (! $dispatcher = optional($this->factory)->getDispatcher()) {
return;
}

if (! $this->request) {
if (! ($dispatcher = optional($this->factory)->getDispatcher()) ||
! $this->request) {
return;
}

Expand Down

0 comments on commit 96518b9

Please sign in to comment.