【问题标题】:Composer Continue With Error CodeComposer 继续错误代码
【发布时间】:2017-01-19 16:02:23
【问题描述】:

我正在尝试使用 composer 自动格式化代码,但是当 php-cs-fixer 修复其中一个目录时,它将以 0 以外的代码退出,并且不会继续修复其余目录。当退出代码不是 0 时,有没有办法告诉作曲家继续?

composer.json:

"csf": [
  "php-cs-fixer fix models/",
  "php-cs-fixer fix config/",
  "php-cs-fixer fix controllers/",
  "php-cs-fixer fix test/"
],

【问题讨论】:

    标签: php shell composer-php


    【解决方案1】:

    改为在.php_cs 配置文件中定义修复路径,例如"

    return PhpCsFixer\Config::create()
        ->setFinder(
            PhpCsFixer\Finder::create()
                ->in([
                    __DIR__.'/models',
                    __DIR__.'/config',
                    __DIR__.'/controllers',
                    __DIR__.'/test',
                ])
        )
    ;
    

    【讨论】:

      猜你喜欢
      • 2014-05-18
      • 1970-01-01
      • 1970-01-01
      • 2021-03-25
      • 2021-09-21
      • 1970-01-01
      • 1970-01-01
      • 2015-03-29
      • 2021-10-12
      相关资源
      最近更新 更多