phpfmt / fmt
此包已被废弃,不再维护。未建议替代包。
K&R 和 phpfmt 编码标准
dev-master
2016-06-01 02:11 UTC
Requires
- php: >=7.0.0
- ext-tokenizer: *
Requires (Dev)
- ccirello/csp: 3.0.*
This package is not auto-updated.
Last update: 2016-06-01 02:11:30 UTC
README
构建状态
要求
- 运行格式化器需要 PHP >= 7.0.0。注意,如果需要,格式化器可以解析和格式化 PHP 文件版本 4。HHVM 不受支持。
编辑器插件
使用方法
$ php fmt.phar filename.php $ php fmt.phar --help Usage: fmt.phar [-hv] [-o=FILENAME] [--config=FILENAME] [--cache[=FILENAME]] [options] <target> --cache[=FILENAME] cache file. Default: .php.tools.cache --config=FILENAME configuration file. Default: .phpfmt.ini --dry-run Runs the formatter without atually changing files; returns exit code 1 if changes would have been applied --ignore=PATTERN-1,PATTERN-N,... ignore file names whose names contain any PATTERN-N --lint-before lint files before pretty printing (PHP must be declared in %PATH%/$PATH) --no-backup no backup file (original.php~) --profile=NAME use one of profiles present in configuration file --version version -h, --help this help message -o=- output the formatted code to standard output -o=file output the formatted code to "file" -v verbose If <target> is "-", it reads from stdin
代码格式化器做什么?
K&R 配置
之前 | 之后 |
|
|
|
|
|
注意它如何排序 use 子句,并移除未使用的子句
|