11

The arguments of my constructor are written on different lines. When I press Ctrl+Alt+Shift+L to format code PhpStorm adds spaces to the shorter argument types so that the columns become of equal length.

I can't figure out which code style settings is responsible for that. I want to disable it.

What it does:

public function __construct(
    AdvertisingDetailsAdapter $advertisingDetailsAdapter,
    AdAccountService          $adAccountService,
    BusinessManagerService    $businessManagerService
)

What I want:

public function __construct(
    AdvertisingDetailsAdapter $advertisingDetailsAdapter,
    AdAccountService $adAccountService,
    BusinessManagerService $businessManagerService
)

1 Answer 1

21

I believe the relevant configuration toggle is shown on the picture

enter image description here

If the picture does not load:

  1. Press Alt+F7 to open the Settings (or choose File => Settings from the main menu)
  2. In the settings dialog, navigate to Editor => Code Style => PHP (from the left pane)
  3. In the right pane, choose the tab Wrapping and Brances
  4. Inside that tab, untoggle the checkmark (tick) from the setting Function declaration parameters => Align when multiline
1
  • 1
    Image is not loading. Can you write down how to do it from Menu? Commented May 9, 2023 at 11:27

Your Answer

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

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