feat: add Time between(), min(), and max() methods#10149
feat: add Time between(), min(), and max() methods#10149michalsn wants to merge 5 commits intocodeigniter4:4.8from
Conversation
Co-authored-by: neznaika0 <ozornick.ks@gmail.com>
| * | ||
| * If $start is after $end, the arguments are swapped. | ||
| * | ||
| * @param DateTimeInterface|self|string $start |
There was a problem hiding this comment.
Time and TimeLegacy extends from DateTimeImmutable and DateTime which both implement the interface, so phpstan would resolve these phpdocs as simply DateTimeInterface|string. Can we update both and make them native param types?
There was a problem hiding this comment.
TimeLegacy is deprecated since 4.3.0. Perhaps it can be removed in 4.8.0
There was a problem hiding this comment.
Done.
As for TimeLegacy - I'm curious to hear what others think. Should we do this now, or is it something that should wait until v5?
There was a problem hiding this comment.
There’s a good point that has been raised here. I think it would be better if we could do this in v5.
There was a problem hiding this comment.
That is something I am asking myself. There's no explicit docs saying what to do for deprecated classes.
There was a problem hiding this comment.
In theory, this is subject to depreciation rules, but I would be cautious in the entire class case.
Co-authored-by: John Paul E. Balandan, CPA <paulbalandan@gmail.com>
Description
This PR adds
between(),min(), andmax()methods to theTimeTrait.Closes #10143
Checklist: