Closed rhertogh closed 1 year ago
Hi, I disagree with this, for two reasons:
1) It's been years since we introduced this syntax and it's been fine, no one asked for this. You can just type array{
without the space and it works.
2) It would be a BC break. Meaning what currently gets accepted as a description would suddenly cause a parse error.
@ondrejmirtes And if we only allow it if it's directly followed by a new line? I don't think that would brake backwards compatibility would it? The reason to implement it is that in my opinion people are used to the PSR format of a leading space before the opening brace and write it as such (which currently won't work).
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi, I would like to propose to allow whitespaces between
array
,object
andlist
and the opening brace for its "shape". E.g.:It would behave more closely to https://www.php-fig.org/psr/psr-12/ where there is (almost) always a space before the
{
.Above code sample works in Psalm: https://psalm.dev/r/c9ff4aa0f0
But does not work in PHPStan: https://phpstan.org/r/7f034238-2d9a-4e58-a7b7-ea850c9e6b1b