-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Apply NullAdapter as Null Object #40780
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
While I do prefer the proposed behavior, I'm unsure if we should simply change it in a bugfix release. Chances are that there are applications out there that rely on the current behavior. The current behavior is not completely unreasonable either: The cache never persists the passed value, which is what |
On my side, I think this is a really bug fix. The cache basically says: " |
If I follow PSR-6, |
yet here we are :)
works for me 👍 |
the change here is precisely about enabling that, by making sure that NullAdapter does not report an error for its expected behavior. |
Then again, that does not render the current behavior inherently wrong. And we're talking about changing the existing behavior in a bug fix. |
@derrabus the current code reports NullAdapter as always having errors when trying to save, which then forces you to do a special case for NullAdapter in any code wanting to report failures loudly, because not persisting the value in NullAdapter is not a failure. It is the expected behavior of the adapter to always miss the cache. See the PR description for such a code. |
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.
All right. 🙂
Thank you @roukmoute. |
There is a problem with the NullAdapter if I have to add an expression to work:
So the goal here is to modify the methods that are causing a problem to behave as a Null Object.