-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint does not like linebreaks since 8.13.0 #1586
Labels
Comments
greg0ire
added a commit
to greg0ire/doctrine-orm
that referenced
this issue
Jun 23, 2023
I tweaked the code so that it would not fall victim to slevomat/coding-standard#1585 or slevomat/coding-standard#1586, thus fixing the phpcs job without losing information or breaking other jobs.
Thanks, @ondrejmirtes will try to fix it in https://github.com/phpstan/phpdoc-parser |
Psalm maintainers recommend to parenthesize the multiline union type: vimeo/psalm#9969 (comment) Which would make it work with phpstan/phpdoc-parser and Slevomat CS too. |
greg0ire
added a commit
to greg0ire/doctrine-orm
that referenced
this issue
Jun 27, 2023
Apparently, there is consensus about multiline types between: - PHPStan - Psalm - Slevomat Coding Standard See slevomat/coding-standard#1586 (comment) Using parenthesis is supposed to be less ambiguous, although I cannot explain how it is ambiguous before… maybe if we had the pipes at the beginning of lines instead of the end it would be ambiguous because you could not clearly tell if the return is multiline or not? Anyway, the change has a positive impact on the Psalm baseline, showing that psalm-return annotation was not really understood previously.
greg0ire
added a commit
to greg0ire/doctrine-orm
that referenced
this issue
Jun 28, 2023
Apparently, there is consensus about multiline types between: - PHPStan - Psalm - Slevomat Coding Standard See slevomat/coding-standard#1586 (comment) Using parenthesis is less ambiguous, it makes it clear to the parser where the type begins and where it ends. The change has a positive impact on the Psalm baseline, showing that psalm-return annotation was not really understood previously.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
causes the rule in the title to kick in. The whole code can be seen at https://github.com/doctrine/orm/blob/4c3bd208018c26498e5f682aaad45fa00ea307d5/lib/Doctrine/ORM/Query/Parser.php#L2569-L2577
The text was updated successfully, but these errors were encountered: