将 phpcs 修复程序的结果存储到文件中

Storing results of phpcs fixer into a file

是否有任何选项可以将 phpcs 修复程序结果的输出存储到文件中?

我尝试了以下

phpcs --standard='Symfony' -a 'path' --report-file='~/Users/uname/Desktop/PHPcs'

但是报错:

ERROR: The specified report file path "~/Users/uname/Desktop/PHPcs" points to a non-existent directory

运行“phpcs --help”获取使用信息

好的,问题解决了。

当您执行以下操作时

phpcs --standard='Symfony' -a app/path --report="~\Users\uname\Desktop\PHPcs\PHPGOG.txt"

您不必创建自己的文件夹

PHPCS 修复程序将在您作为 运行 phpcs 修复程序的同一路径 [在您的代码所在的位置] 生成报告。

好问题!正如 Tomáš Votruba 所说,使用 > 可以为您解决问题。

命令示例

phpcs [your command] > log.txt

该文件将在您执行 运行 命令时所在的目录中创建。