定制 vektah/bugfree-dangerzone 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vektah/bugfree-dangerzone

Composer 安装命令:

composer require --dev vektah/bugfree-dangerzone

包简介

Type verification for php source. Ensures uses and all types within a file verify against the projects auto loader.

README 文档

README

Bugfree Dangerzone is a PHP namespace validator written in PHP. It uses your autoloader to verify that:

  • all of the use statements are valid
  • that all exception catch blocks and type hints have a valid type
  • all doc block types are valid (eg @param Foo $foo)
  • all Doctrine annotations can be resolved (eg @FOobar())
  • access level validation for constructors and static methods
  • Finally that all use statements are actually used.

Getting Started

Add "vektah/bugfree-dangerzone" to your projects composer.json, it should look something like this:

    "require-dev": {
        "vektah/bugfree-dangerzone": "0.2.0"
    },

Then of course:

composer.phar update

to update your dependencies

then run

./vendor/bin/bugfree lint src

If your project has its own autoloader you can use it instead:

./vendor/bin/bugfree lint --bootstrap yourautoloader.php src

XML Output

For use in CI tools like Jenkins some pretty test count output is just not good enough!

To generate machine readable output:

./vendor/bin/bugfree lint src --junitXml junit_results.xml --checkstyleXml checkstyle_results.xml

Configuration

Bugfree Dangerzone is rather picky out of the box, but its easy to decrease its verbosity.

from your projects base directory run:

./vendor/bin/bugfree generateConfig

which will build a config file bugfree.json in your current directory:

{
    "emitLevel": {
        "unableToResolveType": "error",
        "unableToResolveTypeInComment": "error",
        "unableToResolveUse": "error",
        "useOfUnqualifiedType": "warning",
        "useOfUnqualifiedTypeInComment": "warning",
        "duplicateAlias": "error",
        "malformedUse": "error",
        "multiStatementUse": "warning",
        "missingNamespace": "error",
        "unusedUse": "warning"
    }
}

each of these warning types can be either error, warning, or suppress. For example to ignore all messages about missing namespaces then just change

"missingNamespace": "error",

to

"missingNamespace": "suppress",

If the configuration gets updated in the future to have more options then running generateConfig again will keep your current settings and add any new defaults.

统计信息

  • 总下载量: 30.49k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 19
  • 点击次数: 0
  • 依赖项目数: 26
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-07-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固