Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Resolve DateTime value using the Clock#48098
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedNov 3, 2022
Hey! Thanks for your PR. You are targeting branch "6.2" but it seems your PR description refers to branch "6.3". Cheers! Carsonbot |
de3a0fc to60fe79aCompareGromNaN commentedNov 3, 2022
Fromphp doc:
It looks like we cannot change the reference date when using |
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DateTimeValueResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DateTimeValueResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DateTimeValueResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DateTimeValueResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
ae845db tod2929e7Comparedcf32eb toc3bc63cCompare
GromNaN left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Rebased. Ready for a last review.
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DateTimeValueResolver.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
c3bc63c to76d71f6CompareGromNaN commentedDec 5, 2022
I tried to use the new |
nicolas-grekas commentedDec 22, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Now that#48642 is merged, what about leveraging |
GromNaN commentedDec 22, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Dependency injection is simpler here since this is already a service, and this is easy to test. I don't see the benefit of the global object: that adds a required dependency to |
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM thanks (small rebase needed)
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DateTimeValueResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
9319d95 toacf7674Comparenicolas-grekas commentedDec 22, 2022
(tests fail) |
acf7674 to4917528CompareGromNaN commentedDec 22, 2022
Yes sorry, that's fixed. |
nicolas-grekas commentedDec 22, 2022
Thank you@GromNaN. |
…olver (nicolas-grekas)This PR was merged into the 6.3 branch.Discussion----------[HttpKernel] Use TZ from clock service in DateTimeValueResolver| Q | A| ------------- | ---| Branch? | 6.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Fixing#48098 + making tests green by using legit TZ names.Commits-------1acf90e [HttpKernel] Use TZ from clock service in DateTimeValueResolver
Uh oh!
There was an error while loading.Please reload this page.
In order to mock the current time in functional test cases by injecting a
Symfony\Component\Clock\MockClockasclockservice. This is necessary when aDateTimeInterfaceargument is not nullable and we expect the current date time by default.Example when 2 routes are configured on the same controller with an optional parameter.