PHP-CS-Fixer icon indicating copy to clipboard operation
PHP-CS-Fixer copied to clipboard

Blank lines around statement

Open Disservin opened this issue 1 year ago • 0 comments

Feature request

Hi,

I am looking for a feature that would convert this


$isTrue = true;
if ($isTrue) {
    // do something
}
$var = "test";

into


$isTrue = true;

if ($isTrue) {
    // do something
}

$var = "test";

so a feature that adds new a new line and removes blank lines (if there are more than one) around various control structures. Similar can be achieved with blank_line_before_statement but in the case of variables, there is no possible way to achieve that.
I also know that php-cs-fixer isnt there to fix everyones niche coding styles but I think this one is more or less widely used. (Please correct me if I'm wrong and there is actually a way to achieve this without a new feature)

Disservin avatar Aug 08 '22 14:08 Disservin