Prevent PhpStorm from organizing constructor parameters in tabular format
P粉113938880
P粉113938880 2024-01-03 12:41:39
0
1
426

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

I can't figure out which code style setting is causing this. 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
)

P粉113938880
P粉113938880

reply all(1)
P粉099145710

I believe the relevant configuration switches are shown on the picture

If the image cannot be loaded:

  1. Press Alt F7 to open Settings (or select 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, select the Surrounds and Supports tab
  4. Within this tab, uncheck the check mark (check) in Function declaration parameters =>Multiline alignment
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!