Regarding this code:
<?php declare(strict_types = 1);
function F1() : void
{
}
function F2() : mixed
{
return F1();
}
Here, the call to return F1(); is invalid, because function F1 has return type void.
PHP Tools does not detect this, while PHPStan does.
Similar erroneous behavior:
<?php declare(strict_types = 1);
function F1() : void
{
}
$a = F1();
Again, assigning the return value of a call to a void function F1() to a variable $a should be detected as an error. PHP Tools does not, PHPStan does.
My suggestion
Please also detect when accidentally accessing a void return value of a function call.