edmondscommerce/php-parallel-lint

此工具比串行检查快约20倍,用于检查PHP文件的语法。

1.0.3 2019-03-18 09:51 UTC

This package is auto-updated.

Last update: 2024-09-18 23:42:59 UTC


README

请参阅 https://github.com/JakubOnderka/PHP-Parallel-Lint

PHP Parallel Lint

此工具以更花哨的输出方式,比串行检查更快地检查PHP文件的语法。

PHP中的并行作业运行灵感来自Nette框架的测试。

安装

只需运行以下命令即可安装

composer require --dev edmondscommerce/php-parallel-lint

对于彩色输出,还需要安装建议的包 jakub-onderka/php-console-highlighter

composer require --dev jakub-onderka/php-console-highlighter

示例输出

Example use of tool with error

运行选项

  • -p <php> 指定要运行的PHP-CGI可执行文件(默认:'php')。
  • -s, --short 将 short_open_tag 设置为 On(默认:Off)。
  • -a, --asp 将 asp_tags 设置为 On(默认:Off)。
  • -e <ext> 仅检查具有选定扩展名的文件,扩展名由逗号分隔。 (默认: php,php3,php4,php5,phtml,phpt)
  • --exclude 排除文件或目录。如果要排除多个项目,请使用多个排除参数。
  • -j <num> 并行运行作业(默认:10)。
  • --colors 强制在控制台输出中启用颜色。
  • --no-colors 在控制台输出中禁用颜色。
  • --no-progress 在控制台输出中禁用进度。
  • --checkstyle 将结果输出为Checkstyle XML。
  • --json 将结果输出为JSON字符串(需要PHP 5.4)。
  • --blame 尝试显示错误行的git blame。
  • --git <git> Git可执行文件的路径,用于显示blame消息(默认:'git')。
  • --stdin 从标准输入加载要测试的文件和文件夹。
  • --ignore-fails 忽略失败的测试。
  • -h, --help 打印此帮助信息。
  • -V, --version 显示此应用程序版本。

与Symfony框架一起使用的推荐设置

从命令行运行

vendor/bin/parallel-lint --exclude app --exclude vendor .

创建Phar包

PHP Parallel Lint 支持 Box应用 创建Phar包。首先,安装Box应用

curl -LSs https://box-project.github.io/box2/installer.php | php

然后在parallel lint文件夹中运行此命令,这将创建 parallel-lint.phar 文件。

box build

Downloads this Month Build Status Build status License