Recently Added validation rules, you know phpcs install phpcspearinstallPHP_CodeSniffer use phpcs -- config-setencodingutf-8phpcs -- config-settab_width4phpcs -- config-setshow_warings0phpcs -- config-showArray ([encoding] UTF-8 [tab_width]
Recently, validation rules were added to the project, install phpcs pear install PHP_CodeSniffer using phpcs -- config-set encoding = UTF-8 phpcs -- config-set tab_width = 4 phpcs -- config-set show_warings = 0 phpcs -- config-show Array ([encoding] = UTF-8 [tab_width]
Check rules have been added for recent projects, you know
Phpcs
Install phpcs
pear install PHP_CodeSniffer
Use
phpcs --config-set encoding=utf-8 phpcs --config-set tab_width=4 phpcs --config-set show_warings=0 phpcs --config-show Array ( [encoding] => utf-8 [tab_width] => 4 [show_warnings] => 0 ) phpcs -s *.php
Because the project verifies Doc comment and file comment, I used
DoxygenToolkit.vim
The plug-in implements function comment, but for file comment and doc comment, DoxygenToolkit does not meet my project requirements.
So I spent a little time writing a small vim plug-in python, specifically adding annotations that meet my needs,
Commentvim. vim git hub address: https://github.com/childeYin/vim-comment-plugin
Original article address: PHP_CodeSniffer format validation rules. Thank you for sharing them.