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

[9.x] Allow for int value parameters to whereMonth() and whereDay() #43668

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ public function orWhereTime($column, $operator, $value = null)
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string|null $value
* @param \DateTimeInterface|string|int|null $value
* @param string $boolean
* @return $this
*/
Expand All @@ -1403,7 +1403,7 @@ public function whereDay($column, $operator, $value = null, $boolean = 'and')
}

if (! $value instanceof Expression) {
$value = str_pad($value, 2, '0', STR_PAD_LEFT);
$value = sprintf('%02d', $value);
}

return $this->addDateBasedWhere('Day', $column, $operator, $value, $boolean);
Expand All @@ -1414,7 +1414,7 @@ public function whereDay($column, $operator, $value = null, $boolean = 'and')
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string|null $value
* @param \DateTimeInterface|string|int|null $value
* @return $this
*/
public function orWhereDay($column, $operator, $value = null)
Expand All @@ -1431,7 +1431,7 @@ public function orWhereDay($column, $operator, $value = null)
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string|null $value
* @param \DateTimeInterface|string|int|null $value
* @param string $boolean
* @return $this
*/
Expand All @@ -1448,7 +1448,7 @@ public function whereMonth($column, $operator, $value = null, $boolean = 'and')
}

if (! $value instanceof Expression) {
$value = str_pad($value, 2, '0', STR_PAD_LEFT);
$value = sprintf('%02d', $value);
}

return $this->addDateBasedWhere('Month', $column, $operator, $value, $boolean);
Expand All @@ -1459,7 +1459,7 @@ public function whereMonth($column, $operator, $value = null, $boolean = 'and')
*
* @param string $column
* @param string $operator
* @param \DateTimeInterface|string|null $value
* @param \DateTimeInterface|string|int|null $value
* @return $this
*/
public function orWhereMonth($column, $operator, $value = null)
Expand Down