PHPCS / PHPCBF with Grunt 无需全局安装

PHPCS / PHPCBF with Grunt without Global Install

我们使用 Bower 和 G运行t。

在运行宁bower install之后,我得到一个bower_components/phpcs目录。

我的 g运行t 任务是这样设置的:

phpcbf: {
    application: {
        src: ['*.php']
    },
    options: {
        bin: 'bower_components/phpcs',
    }
}

但是,当我 运行 grunt phpcbf 时,我得到错误 bower_components/phpcs: is a directory.

甚至可以 运行 不安装 pear 或 composer 就可以做到这一点吗?

我将 bin 的路径切换为二进制文件,它工作得很好

bin: 'bower_components/phpcs/scripts/phpcs'