当前位置:网站首页>Phpstrom code formatting settings

Phpstrom code formatting settings

2022-06-24 09:57:00 BigChen_ up

Code formatting shortcuts : CTRL+ALT+L

  • Curly braces appear on the same line Such as :
function foo () {
    

} 
  • Variables follow the equal sign = alignment
  • Array key value pairing => alignment

Format code settings :
Click on File/Settings Go to the settings page :
 Insert picture description here

Set up Code Style Realize the alignment of key value pairs in the array
Check :Editor/Code Style/PHP/Wrapping and Braces / Align key-value pairs
Check before :
 Insert picture description here
After checking
 Insert picture description here

Set up Code Style Achieve equal sign alignment

Check :Editor/Code Style/PHP/Wrapping and Braces / Align consecutive assignments

Check before :

 Insert picture description here

After checking :

 Insert picture description here

Set up Code Style Implementation of curly bracket line display
Check :Editor/Code Style/PHP/Wrapping and Braces / Braces placement There is a namespace under 、 Function and so on , If you want the same line to display Can be set to End of line that will do
Check before :

 Insert picture description here

After checking :

 Insert picture description here

原网站

版权声明
本文为[BigChen_ up]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240807401165.html