Stop curly braces from being dropped onto a new line (enclosure functions)

Viewed 48

I have an example code below:

$class->doA("something", function () {})
    ->doB("something else", function () {});

When I run formatter PHPCS changes my code from above to:

$class->doA("something", function () {
})
    ->doB("something else", function () {
    });

What I want is for my code to stay the same. If my enclosure was to have some code, then I would have wanted to keep code within enclosure indented too, as shown below:

$class->doA("something", function () {
        return 1 + 1;
    })
    ->doB("something else", function () {});
0 Answers
Related