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

Invalid $value type in set commands #31

Open
Hint-ru opened this issue May 15, 2017 · 2 comments
Open

Invalid $value type in set commands #31

Hint-ru opened this issue May 15, 2017 · 2 comments
Assignees

Comments

@Hint-ru
Copy link

Hint-ru commented May 15, 2017

All set commands require strings for $value argument, but in fact we can pass mixed (arrays etc), because of serializers.
https://github.com/ukko/phpredis-phpdoc/blob/master/src/Redis.php#L222

    /**
     * Set the string value in argument as value of the key.
     *
     * @param   string  $key
     * @param   string  $value
     * @param   int   $timeout [optional] Calling setex() is preferred if you want a timeout.
     * @return  bool    TRUE if the command is successful.
     * @link    http://redis.io/commands/set
     * @example $redis->set('key', 'value');
     */
    public function set( $key, $value, $timeout = 0 ) {}

"string $value" should be replaced with "mixed $value". For now I get false-positive "expected string" in inspections.

Proof: phpredis/phpredis#450 (comment)

@ukko ukko self-assigned this May 17, 2017
@ukko
Copy link
Owner

ukko commented May 17, 2017

Thanks, will fix soon

@exussum12
Copy link

Any update on this ? the phpstorm stubs are incorrect due to this also

ukko pushed a commit that referenced this issue Jul 31, 2019
- fix type if used serializer
- add new serializer constant
- fix formatting
- fix vars naming, from snake_case to camelCase
- fetch patches from https://github.com/JetBrains/phpstorm-stubs
ukko added a commit that referenced this issue Jul 31, 2019
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

No branches or pull requests

3 participants