remy-theroux/quality-checker

该包已被弃用且不再维护。未建议替代包。

将检查您的PHP项目质量

0.4.0 2016-05-10 20:15 UTC

This package is auto-updated.

Last update: 2019-10-24 09:10:48 UTC


README

PHP命令行质量工具。它允许您使用单个yaml文件检查代码质量。支持的工具包括

  • PHP代码嗅探器 - PHPCS
  • PHP代码混乱检测器 - PHPMD
  • PHP单元测试 - PHPUNIT
  • PHP规范 - PHPSPEC
  • ... 更多即将到来

安装

$ composer require --dev remy-theroux/quality-checker

您必须在您的项目中要求使用每个工具。二进制文件将从您的vendor/bin目录执行。

配置

$ mv vendor/remy-theroux/quality-checker/.qualitychecker.yml.dist .qualitychecker.yml

完整的任务配置在这里

parameters:
  tasks: [phpcs, phpmd]

  # PHPCS configuration
  phpcs:
    # Could be PEAR, PHPCS, PSR1, PSR2, Squiz, Zend or a directory with a ruleset './vendor/iadvize/php-convention/phpcs/Iadvize'
    standard: PSR2
    paths: [./src]
    show_warnings: true
    tab_width: 2
    ignore_patterns: []
    sniffs: []
    timeout: 180

  # PHPMD configuration
  phpmd:
    paths: [./src/]
    format: text
    rulesets: [cleancode, codesize, controversial, design, naming, unusedcode]
    suffixes: [php]
    timeout: 180
    
  # PHPUNIT configuration, only use phpunit.xml configuration file
  phpunit:
    timeout: 180
    
  # PHPSPEC configuration, only use a yml configuration file, file name can be configured
  phpspec:
    config: ./path/to/config/phpspec.yml (default to .phpspec.yml)
    verbose: true
    quiet: true
    timeout: 180

运行

启动所有配置的任务,如果所有任务都成功,则返回状态码0,否则返回-1。质量检查器正在当前位置搜索.qualitychecker.yml文件。

$ ./vendor/bin/qualitychecker

联系

请随时通过github与我们联系,以提出改进、报告错误或简单地给我们一个拥抱。

待办事项

  • 在执行过程中添加日志
  • 添加BEHAT支持