https://psalm.dev/r/88baf4bedf
The docs say:
Mixed Returns the database number (LONG) phpredis thinks it's pointing to or FALSE if we're not connected
yet Psalm seems to think it is guaranteed to return an integer.
I found these snippets:
https://psalm.dev/r/88baf4bedf
<?php
$redis = new Redis;
assert(is_integer($redis->getDbNum()));
Psalm output (using commit f458959):
ERROR: RedundantCondition - 5:8 - int always contains int
Yeah, it may return false: https://github.com/phpredis/phpredis/blob/a311cc4ec3cecdbaf83ba66985efa82137e37cc0/redis.c#L3368-L3377
Closed by c42dada