Skip to content

Commit

Permalink
allow for int value parameters for whereMonth() and whereDay() (#43668)
Browse files Browse the repository at this point in the history
  • Loading branch information
lupinitylabs authored Aug 15, 2022
1 parent bbb9493 commit c951ba7
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit c951ba7

Please sign in to comment.