Psalm: Wrong stub for Redis::getDbNum() ?

Created on 25 Jun 2020  路  3Comments  路  Source: vimeo/psalm

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.

bug

All 3 comments

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

Closed by c42dada

Was this page helpful?
0 / 5 - 0 ratings