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

Class and method braces with no body split onto multiple lines #2275

Open
hackel opened this issue Nov 10, 2023 · 1 comment · May be fixed by #2336
Open

Class and method braces with no body split onto multiple lines #2275

hackel opened this issue Nov 10, 2023 · 1 comment · May be fixed by #2336

Comments

@hackel
Copy link

hackel commented Nov 10, 2023

@prettier/plugin-php v0.21.0
Playground link

Input:

<?php

class CustomException extends \RuntimeException {}

class AnotherClass {
    public function __construct(public int $x, public int $y) {}
}

Output:

<?php

class CustomException extends \RuntimeException
{
}

class AnotherClass
{
    public function __construct(public int $x, public int $y)
    {
    }
}

Expected behavior:
The closed braces {} should remain inline, as per PER CS 2.0.

@hackel hackel linked a pull request Feb 27, 2024 that will close this issue
@czosel
Copy link
Collaborator

czosel commented May 31, 2024

Hi @hackel, sorry for the late feedback! I personally prefer the concise style as you suggest, and it's great to see that PER CS 2.0 also recommends it. @cseufert would you agree that we should move this forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants