
Tools->External Tools -> PHP-CS_FIXER (this is the name you added when you added the extension tool) Working directory Fill in the working directory After the -config is the storage address of this file, according to your actual environment。 fix $FileDir$/$FileName$ -config=C:\Users\XXX\AppData\Roaming\Composer\vendor\php-cs-fixer\diff\src\.php_cs.distģ.
PHPSTORM PSR 1 DOWNLOAD
php_cs.dist Is the official formatting standard, in fact, is a php file, you can download it from the official github repository. Arguments Fill in the parameter configurationĬan use the officially provided rules directly ( $FileDir$ The variable in this format is the PHPstorm macro (Macros)). View the php-cs-fixer path under windows :git bash :which php-cs-fixerĢ. If you don't know the file location after installing php-cs-fixer via Composer, you can find it in the following way: In the picture above ProgramFill in the location of php-cs-fixer.bat: C:\Users\XXX\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat.Php-cs-fixer fix /path/to/project Formatted with PSR2 specification.Php php-cs-fixer fix /path/to/file Format a single php file.Php php-cs-fixer fix /path/to/dir Format the php file below a directory.More use of reference to the official documentation, multiple rules can be separated by ","

Composer installation: composer global require friendsofphp/php-cs-fixer.Project address: This tool is a phar package that can be used as a command line or in conjunction with IDE (PhpStorm). PSR-15 HTTP Request Processor Completed.PSR-12 coding specification extension (under review).


PSR-9 project safety issue announcement (failed).PSR-7 HTTP Message Interface Specification.PSR-0 autoload specification (deprecated).Specific Chinese documentation In the coding we generally strictly abide by the PSR-2 specification.
PHPSTORM PSR 1 HOW TO
This article is to teach you how to use PHP-CS-Fixer for code formatting. In recent years, as the PSR specification has been accepted by the majority of PHPer, the code has gradually become standardized. PHP doesn't have industry-standard industry standards like Java and C++, so code is easy to freeStyle.
