Feature request
when the native type of a property is known, we can auto-fix the "Only booleans are allowed in an if condition" phpstan-strict-error.
same is true for method-calls/function-calls etc. which have a native return-type.
I think this applies to any expression for which we know a non-union native type.
e.g.
class CoffeeBreak
{
private array $arr;
public function getDuration(): int {
if ($this->arr) {
}
}
}
can get fixed to
class CoffeeBreak
{
private array $arr;
public function getDuration(): int {
if (count($this->arr) !== 0) {
}
}
}
https://phpstan.org/r/5a9de50b-cc0c-47c9-81f8-fbe4d609ed4d
Did PHPStan help you today? Did it make you happy in any way?
No response
Feature request
when the native type of a property is known, we can auto-fix the "Only booleans are allowed in an if condition" phpstan-strict-error.
same is true for method-calls/function-calls etc. which have a native return-type.
I think this applies to any expression for which we know a non-union native type.
e.g.
can get fixed to
https://phpstan.org/r/5a9de50b-cc0c-47c9-81f8-fbe4d609ed4d
Did PHPStan help you today? Did it make you happy in any way?
No response