Skip to content

Conversation

@cosmastech
Copy link
Contributor

This method is a soup. I think with an early return, it is made less soupy.

}

try {
$shouldRetry = $this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $response->toException(), $this, $this->request->toPsrRequest()->getMethod()) : true;
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to increase readibility here as well:

Suggested change
$shouldRetry = $this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $response->toException(), $this, $this->request->toPsrRequest()->getMethod()) : true;
$shouldRetry = $this->retryWhenCallback
? call_user_func($this->retryWhenCallback, $response->toException(), $this, $this->request->toPsrRequest()->getMethod())
: true;

@cosmastech cosmastech changed the title [12.x] Reduce indention in PendingRequest@send() with an early return [12.x] Reduce indentation in PendingRequest@send() with an early return Nov 27, 2025
@taylorotwell taylorotwell merged commit 92f5dc9 into laravel:12.x Nov 27, 2025
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants