-
-
Notifications
You must be signed in to change notification settings - Fork 983
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
Fix method annotations in ClientInterface for lpush and similar #1160
base: v2.x
Are you sure you want to change the base?
Conversation
@vladvildanov What the correct annotation for this? |
@tillkruss Are you talking about broken CI or...? |
No, I mean |
@tillkruss In my opinion, we should only support |
@kwidua What do you think about just using |
What about everyone that has used array before, for them the psalm checks would fail then? |
I'm not sure if |
@tillkruss Exactly, it means that it could be P.S New commands support includes only |
I agree with @vladvildanov here, @kwidua. We can update the signatures to If this is causing issues with your linters right now, feel free to update the test suite to resolve it in the |
@tillkruss sorry for the delayed reply. If you prefer |
No worries.
Yes, I meant if any of the tests in the Predis suite need to be adjusted to please your local or CI linters, you can to adjust the code in |
edaba2b
to
fa40521
Compare
@szepeviktor: What's the correct notation to support |
@tillkruss I am sorry. That is called bad design. |
@@ -161,15 +161,15 @@ | |||
* @method int setnx(string $key, $value) | |||
* @method int setrange(string $key, $offset, $value) | |||
* @method int strlen(string $key) | |||
* @method int hdel(string $key, array $fields) | |||
* @method int hdel(string $key, array|string ...$fields) |
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.
@kwidua @szepeviktor: Wouldn't the correct notation be this?
hdel(string $key, array|string $fields, string ...$extra_fields)
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.
No. Variable-length argument lists cannot be in union with something else.
I adjusted the second parameter of
lpush
and other methods where this also applies to bearray|string ...$values
instead of justarray $values
, in order to fix psalm warning.Fixes #1146