-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concept: Utils\DateTime deprecation & replacement #82
Conversation
244b179
to
3356dc4
Compare
I definitely like the idea. 👍 |
Good job 👍 |
createMutable() vs createImmutable() makes users think… |
👍 For immutable only. The only good use-case for mutable DateTime is compatibility with old libraries which accepts |
Agreed, maybe it could be
Exactly. And I think that is very good reason for supporting it. As an example, whole Doctrine stack still does not natively support
Actually, I really thought it was in (I used it in this PR, didn't even realize), but it was reverted afterwards, because Derick was against it. :( php/php-src#1145 |
3356dc4
to
0165413
Compare
6c03b1f
to
a4bddc8
Compare
2998062
to
f6303c6
Compare
46f5434
to
ecbbdfc
Compare
d830ff4
to
580569d
Compare
ba38669
to
bba41ff
Compare
f6984a9
to
eed59a3
Compare
What to do with this? Still doable for 3.0 where DateTime with inheritance sadly still exists, or should I just close it? |
8b993d6
to
98975bf
Compare
8aa61b9
to
fd48510
Compare
e2a373b
to
a316b52
Compare
Hi,
this is an attempt to phase out
Nette\Utils\DateTime
and replace it by a new helper class.The current DateTime makes date & time manipulation easier since it enhances
\DateTime
, yet it has some major flaws: mutability and inheritance.Why should we want the new helper class?
\DateTime
and immutable\DateTimeImmutable
variants, through\DateTimeInterface
;\DateTime
;This PR is a draft, not a final proposal yet. It consists of new tests for existing DateTIme class as well as the actual replacement with tests as well.
I'd like to hear some feedback -- whether is it really what we want (I hope so) and what & how could be eventually changed.
(This depends on #79 which bumps composer.json & Travis versions. Hence Travis fails.)