You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature request for a feature I don't think many are interested in. Still, worth thinking about.
class X {
/** @var ?int **/private$x;
publicfunctiongetX(): int {
$this->x = 5;
$this->modifyX();
return$this->x;
}
privatefunctionmodifyX(): void {
$this->x = null;
}
}
Hack forbids the above code (though to see it you have to change the property type to one hack understands). Psalm, by default, allows the above code, but a config flag makes it follow Hack's behaviour.