Stop PhpStorm from aligning associative arrays

前端 未结 5 1017
失恋的感觉
失恋的感觉 2020-12-16 09:46

How can I tell PhpStorm (using version 8.0.3) to keep the following array as is when clicking Cmd+Alt+L to reformat my code:

$array = [
    \'sh         


        
相关标签:
5条回答
  • 2020-12-16 09:59

    In Phpstorm 2017.3 & later , This setting is located at File | Settings | Editor | Code Style | PHP | Wrapping and Braces | Array initializer | Align key-value pairs

    0 讨论(0)
  • 2020-12-16 10:01

    PhpStorm 2019 and up: Settings -> editor -> PHP -> Wrapping and Braces -> Array initializer -> Align key-value pairs [*] (Linux OS)

    0 讨论(0)
  • 2020-12-16 10:04

    In phpstorm 2019 it goes somewhere like this: (settings > editor > php > Wrapping and Braces > Assignment statement > Align consecutive assignments) PHPStorm 9 align assignments in PHP

    0 讨论(0)
  • 2020-12-16 10:12

    Preferences → Editor → Code Style → PHP → Other → Align key-value pairs

    enter image description here

    0 讨论(0)
  • 2020-12-16 10:16

    Settings (Preferences on Mac) | Editor | Code Style | PHP | Other | Array declaration style -> Align key-value pairs

    enter image description here


    Since PhpStorm 2017.x version it is now located at Settings (Preferences on Mac) | Editor | Code Style | PHP | Wrapping and Braces --> Array initializer | Align key-value pairs

    0 讨论(0)
提交回复
热议问题