It seems there is a Timezone problem. In fact, there is a problem when you try to get a DateInterval between createdAt and expireAt.
1- createdAt (generatedAt) is a timestamp and when you try to create the DateTimeImmutable => the timezone used is UTC.
2 - expireAt use the timezone by default on the server (in my case Europe/Paris). this is a problem when you try to make a diff between these two DateTimeInterface.
For me the good solution will be to get resquestedAt variable from passwordResetRequest object for generating the ResetPasswordToken object.
the quick solution would be to put in the function getExpiresAtIntervalInstance() "$createdAtTime=$createdAtTime->setTimezone($this->expiresAt->getTimezone());"
It seems there is a Timezone problem. In fact, there is a problem when you try to get a DateInterval between createdAt and expireAt.
1- createdAt (generatedAt) is a timestamp and when you try to create the DateTimeImmutable => the timezone used is UTC. 2 - expireAt use the timezone by default on the server (in my case Europe/Paris). this is a problem when you try to make a diff between these two DateTimeInterface.
For me the good solution will be to get resquestedAt variable from passwordResetRequest object for generating the ResetPasswordToken object.
the quick solution would be to put in the function getExpiresAtIntervalInstance() "$createdAtTime=$createdAtTime->setTimezone($this->expiresAt->getTimezone());"