7

PhpStorm is aligning the brackets from an array.

DB::table('something')->create([
                                   'title' => 'John',
                                   'description' => 'Doe',
                               ]); // I don't want to align it this way...


DB::table('something')->create([
    'title' => 'John',
    'description' => 'Doe',
]); // But this way...

Where do I change this at Settings/Preferences > Editor > Code Style > PHP ?

1 Answer 1

11

Finally figured this out!

Go to Preferences > Editor > Code Style > PHP > Wrapping and Braces. Uncheck Align when multiline under Function call arguments.

PhpStorm Preferences Screenshot

2
  • 1
    So thankful I found this. Searched a while for this on my own but didn't associate function call arguments with arrays. Jun 26, 2018 at 8:43
  • 1
    I can finally be at peace Nov 27, 2022 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.