Merge pull request #27544 from thibdrev/patch-1

fix phpstan
This commit is contained in:
Laurent Destailleur 2024-01-15 21:54:31 +01:00 committed by GitHub
commit 47bb0cd17a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -587,7 +587,7 @@ function dol_get_next_week($day, $week, $month, $year)
* True or 1 or 'gmt' to compare with GMT date.
* Example: dol_get_first_day(1970,1,false) will return -3600 with TZ+1, a dol_print_date on it will return 1970-01-01 00:00:00
* Example: dol_get_first_day(1970,1,true) will return 0 whatever is TZ, a dol_print_date on it will return 1970-01-01 00:00:00
* @return int Date for first day, '' if error
* @return int|string Date as a timestamp, '' if error
*/
function dol_get_first_day($year, $month = 1, $gm = false)
{
@ -606,7 +606,7 @@ function dol_get_first_day($year, $month = 1, $gm = false)
* @param int $month Month
* @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ,
* True or 1 or 'gmt' to compare with GMT date.
* @return int Date for first day, '' if error
* @return int|string Date as a timestamp, '' if error
*/
function dol_get_last_day($year, $month = 12, $gm = false)
{
@ -1187,5 +1187,5 @@ function getWeekNumber($day, $month, $year)
{
$date = new DateTime($year.'-'.$month.'-'.$day);
$week = $date->format("W");
return $week;
return (int) $week;
}