Skip to content
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

Space between "return" and parenthesis gets removed unconditionally #509

Closed
markkirchner opened this issue Mar 5, 2024 · 2 comments
Closed
Assignees

Comments

@markkirchner
Copy link

Example:

class Foo
{
    public function bar(int $v = 0): int
    {
        return ($v > 0) ? $v : -42;
    }
}

Problem:
When running the formatter on this, the space between return and the parenthesis always gets removed. This seems to happen regardless of the selected Code Style setting and I could not find a specific formatting rule / overwrite that has any impact on this.

Note:
I know that the parenthesis around the $v > 0 condition are not strictly necessary. And when removing them, everything works as expected.
Still, the formatter should not chose to modify the spacing just because those parens are there.

@Miloslav Miloslav self-assigned this Mar 5, 2024
@Miloslav Miloslav added this to To do in Code Formatting via automation Mar 5, 2024
@Miloslav
Copy link
Member

Miloslav commented Mar 5, 2024

Thank you, will be fixed.

@Miloslav
Copy link
Member

Miloslav commented Mar 6, 2024

This will be fixed in the upcoming pre-release.

Thanks again

@Miloslav Miloslav closed this as completed Mar 6, 2024
Code Formatting automation moved this from To do to Done Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants