2

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 () {});
  • I'm not sure I understand it correctly. You want empty functions to be on one line? What PHP version do you use? Is arrow syntax an option? – Stephan Vierkant Jul 26 '21 at 17:54

0 Answers0