leaseweb / lint-php
此包已被废弃,不再维护。未建议替代包。
用于检查多个PHP文件的命令行工具
0.1.0
2018-07-16 12:17 UTC
This package is not auto-updated.
Last update: 2020-09-09 21:17:03 UTC
README
此包引入了一个简单的bash脚本,可以一次性检查多个PHP文件。
兼容性
此工具应与任何提供lint检查的PHP Cli兼容。
使用方法
只需为工具提供要验证的文件和/或文件夹列表。
$ bin/lint-php test/valid/foo.php test/valid/bar.php
PHP Lint, by Valdir Bruxel Junior and contributors
... 2/2
Validation finished (2 files, 2 valid, 0 errors, 0 skipped)
如果你提供了一个文件夹,它将递归地检查该文件夹中的所有PHP文件。
$ bin/lint-php test/valid
PHP Lint, by Valdir Bruxel Junior and contributors
.......... 3/3
Validation finished (10 files, 10 valid, 0 errors, 0 skipped)
如果遇到任何错误,它将在执行结束时输出遇到的错误。
$ bin/lint-php test/valid test/errors
PHP Lint, by Valdir Bruxel Junior and contributors
E... 4/4
Validation finished (4 files, 3 valid, 1 errors, 0 skipped)
There were 1 file(s) with syntax errors:
1) test/error/with-error.php
PHP Parse error: syntax error, unexpected '=' in test/error/with-error.php on line 3
Errors parsing test/error/with-error.php
如果你提供了一个要验证的不存在的文件,它将被lint检查跳过。
bin/lint-php test/lorem-ipsum.php
PHP Lint, by Valdir Bruxel Junior and contributors
S 1/1
Validation finished (1 files, 0 valid, 0 errors, 1 skipped)
Skipped 1 file(s):
1) test/lorem-ipsum.php
待办事项
- bin/lint-php --colors= ("yes", "no")
- bin/lint-php -h|--help
- bin/lint-php --ignore-folder folder
- bin/lint-php --stop-on-failure
- bin/lint-php --stop-on-skipped
- bin/lint-php -v|--verbose
- bin/lint-php --version
致谢
- PHPUnit,因为我们完全复制了PHPUnit的输出以创建此脚本