You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In several places the Code assumes that \DateTime is being used. That is a problem for me and i would like the bundle to support \DateTimeImmutable. From what i've seen by searching for DateTime its only a few places to change so i will not do a fork & PR for this:
Change the Signatures of UserInterface::setLastLogin and UserInterface::setPasswordRequestedAt (and implementation in User accordingly) to accept \DateTimeInterface instead of \DateTime.
In User.php line 479 change the instanceof check from \DateTime to \DateTimeInterface
I can currently not reset the password of my users because the password reset date is a DateTimeImmutable. That is caused by that instanceof check. I can work around this pretty easily but i still think that code with as much usage as this bundle should not have that kind of bug. You have to, at the very least, throw an exception near that instanceof so that people know what the issue is and dont have to dig into the code.
On the Background of this feature request:
I use \DateTimeImmutableexclusively because the mutability of \DateTime has caused a great deal of trouble for me in the past.
The text was updated successfully, but these errors were encountered:
tmarsteel
changed the title
Support DaetTimeImmutable
Support DateTimeImmutable
Sep 8, 2017
In several places the Code assumes that
\DateTime
is being used. That is a problem for me and i would like the bundle to support\DateTimeImmutable
. From what i've seen by searching forDateTime
its only a few places to change so i will not do a fork & PR for this:Based off of v2.0.1 (4f92bfb):
UserInterface::setLastLogin
andUserInterface::setPasswordRequestedAt
(and implementation inUser
accordingly) to accept\DateTimeInterface
instead of\DateTime
.User.php line 479
change theinstanceof
check from\DateTime
to\DateTimeInterface
I can currently not reset the password of my users because the password reset date is a
DateTimeImmutable
. That is caused by that instanceof check. I can work around this pretty easily but i still think that code with as much usage as this bundle should not have that kind of bug. You have to, at the very least, throw an exception near that instanceof so that people know what the issue is and dont have to dig into the code.On the Background of this feature request:
I use
\DateTimeImmutable
exclusively because the mutability of\DateTime
has caused a great deal of trouble for me in the past.The text was updated successfully, but these errors were encountered: