nette/xray
Composer 安装命令:
composer require --dev nette/xray
包简介
🔬 Nette X-Ray - see exactly how your project uses the Nette ecosystem
README 文档
README
See exactly how your project uses the Nette ecosystem
Ever wondered which Nette methods you call the most? Which Latte filters you actually use? Whether anyone still touches that old configuration key?
Nette X-Ray scans your codebase and gives you a detailed, visual breakdown of your Nette API usage - every method call, every template filter, every config pattern.
✅ deep PHP analysis powered by PHPStan's type system
✅ Latte template analysis - tags, filters, n:attributes
✅ NEON configuration analysis - services, extensions, settings
✅ beautiful standalone HTML report you can explore
✅ completely anonymized - no code, no names, just numbers
How It Works
Nette X-Ray uses static analysis to understand your code precisely - not regex, not guessing. It resolves types through inheritance, detects declaring classes, and tracks argument patterns. The result is an accurate picture of how your project interacts with the Nette ecosystem.
What gets analyzed:
| PHP / PHPT | Latte templates | NEON config |
|---|---|---|
| method & function calls | tags & n:attributes | DI service patterns |
| arguments (positional, named) | filters & their arguments | extension registration |
| return value usage | functions & constants | section usage |
| property access | syntax variants | configuration keys |
| class inheritance & traits | dynamic elements | database keys |
| method overrides | self-closing tags | |
| constants & instantiation | ||
| callable references |
Installation
composer require --dev nette/xray
Requires PHP 8.2 or higher. Runs on PHPStan 2.1. Works with any project using Nette, Latte, Tracy, Dibi, or Texy.
Usage
Point it at your source directories:
vendor/bin/xray app/ src/
That's it. Within moments you get:
- HTML report (
xray-report.html) - an interactive visual breakdown you can open in your browser - JSON data (
xray-report.json) - structured data for further processing
Nette X-Ray
==========
Scanning PHP files ... 142/142 done
Scanning NEON files ... 4/4 done
Scanning Latte files ... 87/87 done
Reports saved to:
xray-report.json
xray-report.html
The HTML Report
The HTML report is a standalone file - no server needed, just open it in your browser. It gives you a complete picture:
- Which Nette APIs your project depends on most
- How you pass arguments - positionally or by name
- Which methods you override from Nette base classes
- Which Latte filters and tags dominate your templates
- How your DI configuration is structured
It's your project's X-Ray.
Configuration
Create a nette-xray.neon file in your project root to customize behavior:
# Default analysis paths (used when no CLI arguments given) paths: - app - src # Additional directories to exclude (vendor, temp, node_modules, .git excluded by default) excludeDirs: - generated # Auto-upload without asking (default: false) upload: true
Help Shape the Future of Nette
When you run Nette X-Ray, you can optionally send the anonymized report to help guide Nette's development:
Share anonymized data with Nette? [y/N] y
Data sent. Thank you!
What gets sent: only aggregated numbers - how many times each API is called, which patterns are used. No file paths, no variable names, no business logic. Just statistics.
Why it matters: real usage data helps prioritize what to improve, what to keep, and what can safely evolve. It's far more reliable than surveys.
Privacy
Nette X-Ray is designed with privacy as a core principle:
- No code is collected - only counts and patterns
- No file paths - you can't tell what the project does
- No string values - argument values are never captured
- Completely optional - data is only sent if you explicitly confirm
- Open source - you can read exactly what gets collected
The JSON report is saved locally first. You can inspect it before deciding to share.
Support Me
Do you like Nette X-Ray? Are you looking forward to the new features?
Thank you!
nette/xray 适用场景与选型建议
nette/xray 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 6, 最近一次更新时间为 2026 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「nette」 「static analysis」 「xray」 「usage statistics」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nette/xray 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nette/xray 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nette/xray 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting
TwigStan is a static analyzer for Twig templates powered by PHPStan
Sentiment analysis library for PHP.
Database Standardization and Analysis Tool for Laravel
Nette Framework adapter for I18n package
Enforce architecture by defining modules with allowed dependencies. Detects forbidden, uncovered, missing and unused module dependencies in PHP projects.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 35
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2026-03-06