Use php-cs-fixer for automatic code formatting in PHPStormģ. So far, PHPStorm has successfully used phpcs and php-cs-fixer to format PSR-2.ġ. Since I enabled Xdebug, there will be Warning here, which means it will affect efficiency and can be ignored. If you need to configure complex rules, it is recommended Use the configuration file to complete.Īfter the plug-in is configured, set a shortcut key in the Keymap, and you can use it The program needs to fill in the executable file address of php-cs-fixer, which is the user directory\Roaming\Composer\composer\vendor\bin\php-cs-fixer.bat on Windows, and ~/.composer/vendor/on linux and mac bin/php-cs-fixerĪrguments/parameters fill in -verbose fix "į i l e N a m e ", the rules field can be viewed in the official php-cs-fixer document, but due to the many limitations of Windows cmd, only simple rules can be passed in. The name and description can be filled in by yourself Step 7: Click to verify success and you are done! !.Step 6: Check PHP Code Sniffer Validation and select PSR2 on the right.Step 5: Node click Editor->Inspections to expand and click PHP on the right.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |