定制 tomasvotruba/phpstan-bodyscan 二次开发

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

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

tomasvotruba/phpstan-bodyscan

Composer 安装命令:

composer require tomasvotruba/phpstan-bodyscan

包简介

Get error count for each PHPStan level

README 文档

README

Downloads total

  • Do you want to get quick glimpse of new project code quality?
  • Do you want to know, what PHPStan level is the best for your project?
  • Do you want to know, how much errors you're facing per level to see how hard it will be to reach them?

Get error count for each PHPStan level!


How does it work?

First, we look into the project root for phpstan.neon file.

  • If found, we reuse it.
  • If not, we look for defaults source code paths like /src, /app, /tests, etc.

Then we run PHPStan for each level from 0 to 8. We count errors and display them in a table.


Install

composer require tomasvotruba/phpstan-bodyscan --dev

Usage

Run tool in your project. It will take some time, as it will run full PHPStan analysis for each level.

vendor/bin/phpstan-bodyscan

To get errors count per level:

+-------+-------------+-----------+
| Level | Error count | Increment |
+-------+-------------+-----------+
|     0 |           0 |         - |
|     1 |          35 |      + 35 |
|     2 |          59 |      + 24 |
|     3 |          59 |         - |
|     4 |         120 |      + 61 |
|     5 |         120 |         - |
|     6 |         253 |     + 133 |
|     7 |         350 |      + 97 |
|     8 |         359 |       + 9 |
+-------+-------------+-----------;

Do you want to run levels without extensions?

vendor/bin/phpstan-bodyscan --bare

Do you need a JSON format?

We got you covered:

vendor/bin/phpstan-bodyscan --json

[
    {
        "level": 0,
        "error_count": 0,
        "increment_count": 0
    },
    {
        "level": 1,
        "error_count": 5,
        "increment_count": 5
    },
    {
        "level": 2,
        "error_count": 25,
        "increment_count": 20
    }
]

Limit level count

Are you interested only in a few levels? You can limit ranges by the options:

vendor/bin/phpstan-bodyscan run --min-level 0 --max-level 3

Load env file

Some projects need to load .env file to run PHPStan. You can do it like this:

vendor/bin/phpstan-bodyscan run --env-file some-parameters.env

Debugging

Running PHPStan on a new project you don't know might crash. To save data from finished levels, we dump them to the bodyscan-log.txt file.

If the run crashes for any reason, the PHPStan error output is also dumped to the same file.


Happy coding!

tomasvotruba/phpstan-bodyscan 适用场景与选型建议

tomasvotruba/phpstan-bodyscan 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 92.16k 次下载、GitHub Stars 达 135, 最近一次更新时间为 2024 年 05 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 tomasvotruba/phpstan-bodyscan 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tomasvotruba/phpstan-bodyscan 我们能提供哪些服务?
定制开发 / 二次开发

基于 tomasvotruba/phpstan-bodyscan 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 135
  • Watchers: 3
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-01