0

This my code:

$sftp = ssh2_sftp($connection);
if ($sftp === false) {

This is the psalm error:

ERROR: TypeDoesNotContainType - src/MyFile.php:159:13 - resource does not contain false
        if ($sftp === false) {

..but the php manual says ssh2_sftp can return false:

This method returns an SSH2 SFTP resource for use with all other ssh2_sftp_*() methods and the ssh2.sftp:// fopen wrapper, or FALSE on failure.

What am I missing here, or what am I not understanding?

dataskills
  • 646
  • 7
  • 15

1 Answers1

0

That's a bug, you need to report it to Psalm developers here: https://github.com/vimeo/psalm/issues

weirdan
  • 2,499
  • 23
  • 27