You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a function has a return type and an additional new line between the brace and function signature, phpcbf will remove the return type.
@markstory Oh wow! Thanks for reporting this. Very curious to realize nobody has reported this before, even though return types have been used for years now.
Issue is reproducable and confirmed.
While when running with PSR12, the issue points to the Squiz.Functions.MultiLineFunctionDeclaration.BraceSpacing error code, the actual issue is in the Generic.Functions.FunctionOpeningBraceBsdAllman sniff.
gsherwood
changed the title
MultiLineFunctionDelclaration.BraceSpacing removes return type when additional lines are present.
Generic.Functions.OpeningFunctionBraceBsdAllman removes return type when additional lines are present
May 27, 2021
Describe the bug
When a function has a return type and an additional new line between the brace and function signature,
phpcbf
will remove the return type.Code sample
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcbf --standard=PSR12 test.php
phpcbf will update the problematic formatting, however the resulting code looks like:
Expected behavior
Formatting to be updated without removing the return type.
The text was updated successfully, but these errors were encountered: