Skip to content

Conversation

AhmedAlaa4611
Copy link
Contributor

Description

Some PHPDoc use string|false, others use false|string. While both are technically valid, I think Laravel uses success type first. Here's where it’s inconsistent:

  • forHumans() currently uses false|string.
  • format(), percentage(), currency(), and summarize() uses string|false.

So let's refine them.

@shaedrich
Copy link
Contributor

Another pattern, I'm aware of, is using the

  • most likely outcome first
  • return types in the order they occur (early returns, etc.)

@taylorotwell taylorotwell merged commit 5ad0a1c into laravel:12.x Jul 3, 2025
62 checks passed
mohammad-fouladgar pushed a commit to mohammad-fouladgar/framework that referenced this pull request Jul 22, 2025
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