VSCode 1.55.0 (Windows)
“Local variables should not be declared and then immediately returned or thrown (php:S1488)”
Is not only triggered for
[...] $local_variable ='value'; return $local_variable;
where it makes a lot of sense but also for
$local_variable = ''; $local_variable .= 'append something'; [...] $local_variable .= 'append the last thing'; return $local_variable;
where it would be difficult to include the value of the local variable in the return statement.
Bug or feature?