Skip to content

[12.x] Annotate tuple return type of Number::pairs()#58409

Merged
taylorotwell merged 1 commit into
laravel:12.xfrom
ismaildasci:fix/number-pairs-return-type
Jan 19, 2026
Merged

[12.x] Annotate tuple return type of Number::pairs()#58409
taylorotwell merged 1 commit into
laravel:12.xfrom
ismaildasci:fix/number-pairs-return-type

Conversation

@ismaildasci

Copy link
Copy Markdown
Contributor

This PR improves the return type annotation for Number::pairs() from generic array to list<array{int|float, int|float}>.

The method returns a list of two-element arrays where each array contains the lower and upper bounds of a range. The new type annotation accurately describes this structure.

Benefits:

  • ✅ Improved static analysis accuracy
  • ✅ Better IDE type inference
  • ✅ Enhanced developer experience with precise autocompletion

Similar to #58354 which annotated tuple return types for TableGuesser::guess().

Improved the return type from generic `array` to `list<array{int|float, int|float}>` which accurately describes that the method returns a list of two-element tuples containing the lower and upper bounds.

This improves:
- Static analysis accuracy
- IDE type inference
- Developer experience with better autocompletion
@taylorotwell taylorotwell merged commit 82adfcd into laravel:12.x Jan 19, 2026
72 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.

2 participants