Skip to content

Incorrect code in the documentation #124

@fx1234

Description

@fx1234

Hi

first of all: great project! thanks for that

It is about the following code (under Promises in the documentation):

$redis->get($key)->then(function (string $value) {
    var_dump($value);
}, function (Exception $e) {
    echo 'Error: ' . $e->getMessage() . PHP_EOL;
});

the problem is if the key doesn't exist, the returned value is NULL. therefore nothing will happen because a string-value is expected in the function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions