Home > Backend Development > PHP Tutorial > How to format code in phpstorm

How to format code in phpstorm

不言
Release: 2023-04-03 07:22:01
Original
12872 people have browsed it

This article mainly introduces the PhpStorm code formatting settings, which has certain reference value. Now I share it with you. Friends in need can refer to it

PhpStorm The default shortcut key for formatting is Ctrl Alt F, but some formatting effects need to be set by yourself. For example, if you want the PHP code to be aligned with equal signs during formatting, you need to configure it yourself. First open phpstorm and find Setting/Editor/Code Style/PHP as shown below:

How to format code in phpstorm

(Scheme Select Default to set the IDE. If you select Project, it is only for the current Project is valid)

1. Set equal sign alignment Select Wrapping and Braces, check Align consecutive assignments and Align Key-Values ​​Pairs, as shown in the figure:

How to format code in phpstorm

2. Automatically convert array() to [] Select Code Conversion, check Force short declaration style and Add a comma ater last element in multiline array, as shown in the figure :

How to format code in phpstorm

The above is the entire content of this article. I hope it will be helpful to everyone’s study. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

PHPstrom installation and use tutorial

php how to implement random numbers and letters verification code code

The above is the detailed content of How to format code in phpstorm. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template