Skip to content
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

Throw when passing an empty array to mget() instead or returning false #2422

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

alexandre-daubois
Copy link

@alexandre-daubois alexandre-daubois commented Nov 23, 2023

Fix #1810, related to symfony/symfony#52700 and symfony/symfony#52668

image

The stub doesn't allow false to be returned, however that's what happen when calling mget with an empty array. I propose to throw an exception about it when this happen. This allow to keep the current mget return type.

@dkarlovi
Copy link

dkarlovi commented Nov 23, 2023

#1810 implied they don't want to throw exceptions, probably the signature needs to change. They said this would require a major release which in the meantime happened (v6) so from my POV the signature not being updated in the v6 is a bug, it shouldn't be seen as a BC break, it was just forgotten before v6.0.0 release.

@alexandre-daubois
Copy link
Author

This is not what I understood from the issue 🤔 that an exception is a better solution than returning false. If you're going to introduce a breaking change, we might as well implement the exception?

@dkarlovi
Copy link

#1810 (comment) is arguing returning false is better since it's not possible to return false as a non-error condition.

In that case, since the current behaviour is the intended behaviour, I'd argue the stub needs to be updated to reflect that and it not being updated for v6 is a bug. Maybe @yatsukhnenko or some other maintainer can weigh in.

/cc @greg0ire

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mGet return false when no keys are provided
2 participants