Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Invalid $value type in set commands #31

Open

Description

@Hint-ru

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)

Activity

  1. self-assigned this
    on May 17, 2017
  2. ukko commented on May 17, 2017

    @ukko
    Owner

    Thanks, will fix soon

  3. exussum12 commented on Jul 17, 2019

    @exussum12

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

  4. added 2 commits that reference this issue on Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions