<?php
function check(string $filename): bool
{
if (strpos($filename, ".suback.php") !== false || strpos($filename, "_backup") !== false) {
// we'll ignore .suback files, they are old upgrade backups
return false;
}
return true;
}
The latest psalm/phar 4.12.0 returns:
ERROR: RedundantCondition - t.php:4:9 - int can never contain false (see https://psalm.dev/122)
if (strpos($filename, ".suback.php") !== false || strpos($filename, "_backup") !== false) {
ERROR: RedundantCondition - t.php:4:55 - int can never contain false (see https://psalm.dev/122)
if (strpos($filename, ".suback.php") !== false || strpos($filename, "_backup") !== false) {
Consider the following code:
The latest psalm/phar
4.12.0
returns:While psalm.dev returns expected result
https://psalm.dev/r/0cc1635fe5