feat(appframework): ⌚ Make ITimeFactory extend \PSR\Clock\ClockInterface#35872
feat(appframework): ⌚ Make ITimeFactory extend \PSR\Clock\ClockInterface#35872nickvergessen merged 1 commit intomasterfrom
Conversation
ChristophWurst
left a comment
There was a problem hiding this comment.
Given how easy it is to get a mutable object form the immutable one I wouldn't include the helper but I'm okay if we do.
Nice addition to the PSR API family 👍
|
Might or might not make sense to deprecate |
Same for the getDateTime() I think |
| return \DateTime::createFromImmutable($this->now()); | ||
| } | ||
|
|
||
| public function withTimeZone(\DateTimeZone $timezone): static { |
There was a problem hiding this comment.
: static is 8.0+ only, but currently linting is still run against 7.4 while we plan to drop it.
Could remove the typing for now, or we keep it and make sure the 7.4 lint job is removed already
589cf70 to
c4e4d91
Compare
c4e4d91 to
2b12b75
Compare
|
I would love to see this documented at https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/psr.html :) |
|
Will do, after it's merged |
2b12b75 to
acf0412
Compare
|
Rebased, now that 7.4 is dropped |
|
Dang, this slipped through. To preserve stability in OCP, I'm moving it to 27 |
Signed-off-by: Joas Schilling <coding@schilljs.com>
acf0412 to
c297f8e
Compare
|
Docs in #37039 (comment) and nextcloud/documentation#9722 |
| * Use this to get a timestamp or DateTime object in code to remain testable | ||
| * | ||
| * @since 8.0.0 | ||
| * @since 26.0.0 Extends the \Psr\Clock\ClockInterface interface |
There was a problem hiding this comment.
are you sure about that? ;)
There was a problem hiding this comment.
YOu mean extends vs implements?
There was a problem hiding this comment.
I'm pretty sure it's correct here, but yeah on the actual implementation the comment could be adjusted
There was a problem hiding this comment.
The since 26. I just had Mail integration tests fail because I used now for 26. It's only there for 27+ :)
There was a problem hiding this comment.
Ah, yeah see comment above:
Dang, this slipped through. To preserve stability in OCP, I'm moving it to 27
Sorry about that :(
There was a problem hiding this comment.
Summary
TODO
Checklist