Skip to content

[12.x] Fix typehints for partition() #56388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2025
Merged

Conversation

cosmastech
Copy link
Contributor

This gives a PHPStan error:

User::get()->partition('team_id', 100);
image

however the code runs just fine

image

@browner12
Copy link
Contributor

I don't think going to mixed is the right solution here, as you lose a bunch of information.

@cosmastech
Copy link
Contributor Author

cosmastech commented Jul 23, 2025

I don't think going to mixed is the right solution here, as you lose a bunch of information.

What information do you feel is lost, and what do you think might be a better solution?

This is the same signature that Collection@where() has, for instance

image

@taylorotwell taylorotwell merged commit 630156f into laravel:12.x Jul 23, 2025
62 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