Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Clock] Return Symfony ClockInterface in ClockSensitiveTrait#53080
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
alexandre-daubois commentedDec 15, 2023
In the same idea, I'm not sure to clearly understand the convention in the code base on which class to use when one is available in Contracts, PSR and in the component itself (e.g. EventDispatcher)? 🤔 |
nicolas-grekas commentedDec 18, 2023
No specific reason I can think of...
See SOLID principles: use the most abstract interface when it fits your need. If you need a more capable interface, use the more capable one. |
stof commentedDec 18, 2023
Anytime a component only needs the API of the PSR interface, we use that as parameter type as it makes the component usable with any PSR-20 implementation and not just |
alexandre-daubois commentedDec 18, 2023
Got it, thank you both 👍 |
nicolas-grekas commentedDec 26, 2023
@ruudk please advise what you'd like to do with this PR. "Draft status" is blurry for OSS maintainers. |
ruudk commentedJan 2, 2024
I made it Draft because I wasn't sure. So I made it ready for review now. I think that the return type should be the thing that is going to be returned. That allows the developer, when using this in the test, to call |
xabbuh 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.
for 7.1 (this doesn't look like a bugfix to me)
I don't understand why the ClockSensitiveTrait::mockTime returns a PSR ClockInterface, instead of a Symfony ClockInterface.Is this done on purpose? Or was this a mistake?
fabpot commentedJan 6, 2024
Thank you@ruudk. |
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas I don't understand why the ClockSensitiveTrait::mockTime returns a PSR ClockInterface, instead of a Symfony ClockInterface. Is this done on purpose? Or was this a mistake?