Having this example code:
<?php declare(strict_types = 1);
function FooBar() : mixed
{
$a = array(1, 2, 3);
if(rand()===3)
{
foreach($a as $e)
{
if($e==2)
{
return $e;
}
}
}
else
{
return null;
}
}
Here, I am missing a return statement.
PHP Tools does not detect it. PHPStan does:
Function FooBar() should return mixed but return statement is missing.
Suggestion
Please make PHP Tools also detect missing return statements.