Skip to content
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

Add dates to allowed PHPDoc types of Builder::having() #54899

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

miken32
Copy link
Contributor

@miken32 miken32 commented Mar 4, 2025

Dates work fine in a having() clause; Illuminate\Database\Connection::prepareBindings() is explicitly checking for a \DateTimeInterface object so that's what I've used in the comment.

This prevents phpstan from complaining:

Parameter #3 $value of method Illuminate\Database\Query\Builder::having() expects float|int|string|null, Illuminate\Support\Carbon given. 

Related, I also noted (but didn't change) that Builder::havingBetween() is checking for a Carbon\CarbonPeriod instance, but should probably be checking for its ancestor \DatePeriod instance instead. This would maintain consistency with other checks later in the code.

@taylorotwell taylorotwell merged commit 154a0f1 into laravel:12.x Mar 5, 2025
41 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