Hi,
For the following code:
/**
* @return int[]
*/
function a(): array{
return ['a b'=>0];
}
If we run the command vendor\bin\psalm --alter --issues=all
Psalter will transform the docblock into:
/**
* @return int[]
*
* @psalm-return array{a b: int}
*/
However, this kind of notation is not allowed, and psalm will then flag an error:
ERROR: InvalidReturnStatement - test.php:15:12 - The inferred type 'array{a b: int(0)}' does not match the declared return type 'array{ab: int}' for a (see https://psalm.dev/128)
return ['a b'=>0];
I guess Psalter could skip the detailed "@psalm-return" when this happens
Thanks
Hey @orklah, can you reproduce the issue on https://psalm.dev ?
Yeah, Psalm should format this with quotes.
Should be fixed now!