Home > php教程 > php手册 > PHP_CodeSniffer 格式校验规则

PHP_CodeSniffer 格式校验规则

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:13:40
Original
1358 people have browsed it

最近项目加上了校验规则,你懂的 phpcs 安装 phpcs pear install PHP_CodeSniffer 使用 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]

最近项目加上了校验规则,你懂的

phpcs

安装 phpcs

   pear install PHP_CodeSniffer
Copy after login

使用

 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
Copy after login

由于项目中校验了 Doc comment,file comment ,我使用了

  DoxygenToolkit.vim
Copy after login

插件做function comment,但是对于 file comment,doc comment 来说DoxygenToolkit 并不满足我的项目

于是我花了一点时间用 python 写了一个小的 vim 插件,专门添加符合我需求的注释,

  commentvim.vim
 git hub 地址 : https://github.com/childeYin/vim-comment-plugin
Copy after login
Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template