Skip to content

Conversation

AhmedAlaa4611
Copy link
Contributor

@AhmedAlaa4611 AhmedAlaa4611 commented Oct 12, 2025

Description

This PR avoid repeating the same condition.

Based on #57351 but narrowed in scope.

Edit

Some developers see cleanup PRs as "noise" because they don't add features or fix visible bugs. But in reality, cleanup is essential to maintain long-term stability of a project.

@leepownall
Copy link
Contributor

What's the aim with all these minor changes? Are they really worth it? It seems to me that it creates a lot of noise for the maintainers.

@hctorres02
Copy link

Maybe, the next step will be:

use Illuminate\Support\Arr;

$isForgeOrVapor = Arr::some(
    ['.on-forge.com', '.on-vapor.com'],
    fn ($domain) => str_ends_with($request->host(), $domain)
) || laravel_cloud();

if (is_null($trustedIps) && (laravel_cloud() || $isForgeOrVapor)) {
    $trustedIps = '*';
}

if ($isForgeOrVapor) {
    $request->headers->remove('X-Forwarded-Host');
}

irony included

@NickSdot
Copy link
Contributor

What's the aim with all these minor changes? Are they really worth it? It seems to me that it creates a lot of noise for the maintainers.

It does create noise. I think Ahmed does a good job of cleaning up and unifying things. It's similar to Browner12's efforts to reduce call stack sizes. Overall, I think it is worth it and we shouldn't discourage it.

@shaedrich
Copy link
Contributor

What's the aim with all these minor changes? Are they really worth it? It seems to me that it creates a lot of noise for the maintainers.

Unlike the previous PR, this is not meant to be a performance optimization but rather better formatting. if statement that span multiple lines aren't exactly readable.

@leepownall
Copy link
Contributor

I just look through the open PRs sometimes and see so many low effort minor tweaks it almost seems a little performative, that people just do it to say they have contributed. The contributions may be technically correct but do they really need to be done? Is it really moving the framework forward? Just a lot of noise/distraction for Taylor.

@shaedrich
Copy link
Contributor

In general, I absolutely agree, however, I wouldn't count this PR in particular to the ones that are small and kinda opinionated. This, to me, is an exception since it actually does add value, however little, granted.

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.

6 participants