如何抑制 Composer 脚本回显执行的命令?

cal*_*-io 7 php composer-php

如果我在文件中指定脚本composer.json

"scripts": {
  "test": "@php phpunit -c phpunit.xml"
}
Run Code Online (Sandbox Code Playgroud)

Composer 在执行时会回显该命令:

$user> composer test
> @php @php phpunit -c phpunit.xml
PHPUnit 8.0.1 by Sebastian Bergmann and contributors.
...
Run Code Online (Sandbox Code Playgroud)

有没有办法抑制 Composer 输出中的 echo 命令?

编辑:

我希望输出看起来像这样:

$user> composer test
PHPUnit 8.0.1 by Sebastian Bergmann and contributors.
...
Run Code Online (Sandbox Code Playgroud)

小智 2

在命令行上这应该是不可能的。您可以将输出保存到文件中:

    "tests": [
        "@php phpunit -c phpunit.xml 2>&1 | tee COMPOSER-LOG",
        "@php -v 2>&1 | tee COMPOSER-LOG"
    ]
Run Code Online (Sandbox Code Playgroud)