Skip to content

Inherent phpredis variance handled incorrectly #10215

@curry684

Description

@curry684

Bug report

PHPStan 1.10.41 introduced a bunch of fixed signatures for Redis (https://github.com/phpstan/phpstan/releases/tag/1.10.41), thanks to @Vaalyn. Some previously fine code is now not passing though, specifically because the strong typing now incorrectly causes PHPStan to think Redis calls are repeatable.

Code snippet that reproduces the problem

https://phpstan.org/r/1d8101fa-a6d5-4bcb-b858-20045e24c344

Expected output

This should just pass, the callback is expected to fill the cache in Redis, causing a different result on the second test.

Even without the callback, another process could fill the key in the microseconds between both calls.

Did PHPStan help you today? Did it make you happy in any way?

Of course 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions