Psalm adds null as a possible value to a variable that never gets assigned null.
After the comparison $as value according to psalm is -1|null
<?php
$a = -1;
if ($a !== null) {
}
echo $a;
Obviously the if block serves no purpose here. However the same problem occurred in a more complex function where an int variable was compared to an int|null variable.
https://psalm.dev/r/1502d48747