jdecool/phpstan-report
Composer 安装命令:
composer create-project jdecool/phpstan-report
包简介
Enhance PHPStan analysis by providing report analysis
README 文档
README
A simple wrapper around PHPStan to extends PHPStan's functionality by providing a customizable report generation feature. It allows you to run PHPStan analysis and generate reports on ignored errors in various formats.
Installation
You can install the package via composer:
composer require --dev jdecool/phpstan-report
Usage
This package provides two main commands:
Analyze Command
The analyze command runs PHPStan analysis and generates reports on ignored errors:
php vendor/bin/phpstan-report analyze
Options
--report-output-format: Specify the output format for the report--report-without-analyze: Generate a report without running the PHPStan analysis--report-continue-on-error: Continue report generation even if the analysis fails--report-maximum-allowed-errors: Set the maximum number of allowed errors--report-sort-by: Sort the report results (options: identifier, occurrence)--report-exclude-identifier: Identifier to exclude from the report (accepts multiple values)--report-file-<format>: Export report in an output file for a particular format--report-http-target-url: The target URL to send the report to (available only if output format ishttp)--report-http-add-header: Add a header to the HTTP request (available only if output format ishttp)--report-gitlab-severity-mapping: JSON string mapping error identifiers to GitLab severity levels (available only if output format isgitlab)
Available formats are: text, html, http, json, gitlab and heatmap.
For a full list of options, run:
php vendor/bin/phpstan-report analyze --help
View Command
The view command displays detailed information about specific ignored errors from the PHPStan result cache:
php vendor/bin/phpstan-report view <identifier> [<identifier>...]
This command allows you to examine specific error identifiers without running a new analysis.
Options
--refresh-cache: Refresh PHPStan cache by running a new analysis before viewing errors
The view command takes error identifiers as arguments and displays detailed information about those errors in a table format showing:
- Error identifier
- Error message
- File path
- Line number
For help with the view command, run:
php vendor/bin/phpstan-report view --help
Examples
Run analysis and generate a text report:
php vendor/bin/phpstan-report analyze src tests
Generate an HTML report without running analysis:
php vendor/bin/phpstan-report analyze --report-without-analyze --report-output-format=html
Run analysis, continue on error, and save report to a file:
php vendor/bin/phpstan-report analyze --report-continue-on-error --report-file-json=report.json src
Generate a heatmap report of files with most ignored errors:
php vendor/bin/phpstan-report analyze --report-file-heatmap=heatmap.svg src
Generate a GitLab report with custom severity mapping:
php vendor/bin/phpstan-report analyze --report-output-format=gitlab \
--report-gitlab-severity-mapping='{"missingType.property":"info","argument.type":"critical"}' src
For more details on GitLab severity mapping, see docs/gitlab-severity-mapping.md.
View Command Examples
View details about a specific error identifier:
php vendor/bin/phpstan-report view "missingType.iterableValue"
View details about multiple error identifiers:
php vendor/bin/phpstan-report view "missingType.iterableValue" "nullCoalesce.expr"
jdecool/phpstan-report 适用场景与选型建议
jdecool/phpstan-report 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 33.45k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2024 年 08 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 jdecool/phpstan-report 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jdecool/phpstan-report 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 33.45k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-21