php-cs-fixer-custom-fixers icon indicating copy to clipboard operation
php-cs-fixer-custom-fixers copied to clipboard

Request: empty method to single line

Open onet4 opened this issue 2 years ago • 2 comments

Hello,

I have a request.

I'd like to make the following code.

    public function test()
    {
    }

to

    public function test() {}

,similar to ConstructorEmptyBracesFixer, as the former takes too much space. Would be appreciated if you could create one for such a case.

Thank you for your consideration.

onet4 avatar Feb 26 '22 13:02 onet4

I wonder what about these cases:

function a(): void
{
}
function b(
    int $x
)
{
}

not mentioning other cases.

Maybe it is worth raising a discussion in a main repo.

kubawerlos avatar Mar 26 '22 07:03 kubawerlos

I'd like to see them being converted to:

function a(): void {}
function b( int $x ) {}

onet4 avatar Mar 26 '22 11:03 onet4