PSR-20: does it need to avoid any direct call to date, time and date time objects? #12
clementvtrd
started this conversation in
Polls
Replies: 2 comments 5 replies
|
I find the way of bringing the poll a bit odd. The poll is not about the PSR but about the rule: if we decide to enforce the PSR via a rule, then, indeed, all time-related constructs should be reported, as it makes total sense to only use the ClockInterface. |
1 reply
|
I agree to forbid the usage of relative date, but not with "Forbid all usage of date time constructor". Because we might need to use a specific date as |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Ambiguous
What about relative date? For example
new \DateTimeImmutable('-1 day')? For the same reason as for current timestamp, shouldn't it be made through the clock?Before
Sources
https://www.php-fig.org/psr/psr-20/
3 votes ·
All reactions