plugin-php icon indicating copy to clipboard operation
plugin-php copied to clipboard

Class and method braces with no body split onto multiple lines

Open hackel opened this issue 2 years ago • 0 comments

@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 avatar Nov 10 '23 21:11 hackel