Level 51
Have you tried setting the following in your config as per https://cs.sensiolabs.org/
blank_line_before_statement => ['if'],
Might get you at least part way there
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi.
I have got Php-cs-fixer up and running and its doing its thing, but I want it to automatically add a line above and below if else statements, i.e::
// from this
if ($payment_type == 1) { // New Account
$update_duration = $this->updateDuration($user, $duration);
$update_balance = CustomerCreditBalance::where('user_id', $user->id)->update(['current' => 20 - ($balance_transaction->fee / 100),]);
$account = CustomerAccount::where('user_id', $user->id)->update(['status_id' => 3]);
$payment = Ledgers::save($user, $transaction_type, $cost, $charge->id, null, $payment_title . ' - ' . $user->username, null, null, 5, $balance_transaction->fee / 100, 'Stripe');
event(new AccountSetupComplete($user, $payment));
} elseif ($payment_type == 2) { // Renewal 2-3
// To this
if ($payment_type == 1) { // New Account
$update_duration = $this->updateDuration($user, $duration);
$update_balance = CustomerCreditBalance::where('user_id', $user->id)->update(['current' => 20 - ($balance_transaction->fee / 100),]);
$account = CustomerAccount::where('user_id', $user->id)->update(['status_id' => 3]);
$payment = Ledgers::save($user, $transaction_type, $cost, $charge->id, null, $payment_title . ' - ' . $user->username, null, null, 5, $balance_transaction->fee / 100, 'Stripe');
event(new AccountSetupComplete($user, $payment));
} elseif ($payment_type == 2) { // Renewal 2-3
Any ideas on how to do it. I can seem to find the settings in the docs.
Cheers
Please or to participate in this conversation.