Added methods setBirthday(string|RegisteredPeerRecord $peer, int $year, int $month, int $day): void and deleteBirthday(string|RegisteredPeerRecord $peer): void to \Socialbox\Managers > RegisteredPeerManager

This commit is contained in:
netkas 2025-01-06 15:11:14 -05:00
parent 20fa093463
commit c0de6ce006
3 changed files with 142 additions and 0 deletions

View file

@ -55,4 +55,17 @@
{
return preg_match("/^\+[0-9]{1,15}$/", $phoneNumber) === 1;
}
/**
* Validates whether the given date is a valid gregorian calendar date.
*
* @param int $month The month component of the date (1 through 12).
* @param int $day The day component of the date.
* @param int $year The year component of the date.
* @return bool Returns true if the provided date is valid, otherwise false.
*/
public static function validateDate(int $month, int $day, int $year): bool
{
return checkdate($month, $day, $year);
}
}