Sitelet https://github.com/phpredis/phpredis/issues/2669
Skip to content

Documentation regarding return types is incorrect #2669

Description

@thepurpleblob

For example...

ZRangeByScore... README says...

Return value
Array containing the values in specified range.

However, the declaration disagrees...

public function zRangeByScore(string $key, string $start, string $end, array $options = []): Redis|array|false;

public function zRangeByScore(string $key, string $start, string $end, array $options = []): Redis|array|false;

Which says that return types can be Redis, array or false.

This may seem trivial, but if you take the documentation at its word when using the extension it's asking for run time type errors.

I would have thought there are (many?) other instances but this is the one that I came across.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions