Incorrect birth date for emtpy value
https://github.com/microsoftgraph/msgraph-sdk-php/blob/72192f38679c7def0daac0cf53648cdebcf96256/src/Beta/Microsoft/Graph/Model/Contact.php#L64
API responsed null for undefined Day of birth. For this case, msgraph-sdk-php will return the current date.
Solution: need additional check value !== null AB#10295
Hello @gorets, thanks for reporting the issue. I can see there is a check on https://github.com/microsoftgraph/msgraph-sdk-php/blob/72192f38679c7def0daac0cf53648cdebcf96256/src/Beta/Microsoft/Graph/Model/Contact.php#L65
To check if the key contains null before creating a new DateTime() object.
Are experiencing any unexpected behavior?
Hello @gorets, thanks for reporting the issue. I can see there is a check on https://github.com/microsoftgraph/msgraph-sdk-php/blob/72192f38679c7def0daac0cf53648cdebcf96256/src/Beta/Microsoft/Graph/Model/Contact.php#L65
To check if the key contains null before creating a new
DateTime()object. Are experiencing any unexpected behavior?
No, this solution don't resolve problem. If input value is null, we going to the else and execute new \DateTime(null) and received current date.
Recommended solution: if (array_key_exists("birthday", $this->_propDict) && !is_null($this->_propDict["birthday"])) { }
Resolved in latest v1 release